package persons;

import java.util.Objects;

/**
 * Created by fcmam5 on 11/13/15.
 * Implemented by Mouilah-Sarra
 */
public class Donor extends Personne {
    private static int donNum = 0;
    private int quantite;
    private boolean motivation;
   /* private Object donorCard[] = new Object[3];// [[int DonorKey]|[String email]|[int telNumber]] //base de donnée ! pas besoin de ce tableau */
  private  String mail;
  private int numTel;

    public Donor(String name, String firstName, int age, String grouping, String[] adresse, int quantite, boolean motivation,String mail, int numTel) {
        super(name, firstName, age, grouping, adresse);
        this.donNum++;
        this.quantite = quantite;
        this.motivation = motivation;
         this.mail=mail;
        this.numTel=numTel;
    }


    public void setGroupage (String gropage){
        setGrouping(gropage);
        
}
    public String getGroupage(){
        return getGrouping();
}

    public int getDonNum( ){
        return this.donNum;
       
    }

    // HOw much he gives ?
    public void setQuantite (int quantite){
    this.quantite=quantite;
}

    public int getQuantite (){
        return this.quantite;
    }
      public void setMail(String mail){
         this.mail=mail;
         
    }
    public String getMail(){
         return mail;
    }
    public void setNumTel(int numTel){
         this.numTel=numTel;
    }
    public int getNumTel(){
         return numTel;
    }


    /**
     *  if He is motivated let's keep his infos in a table :
     *  [[String DonorKey]|[String email]|[int telNumber]]
     *  DonorKey is [firstDon+the name & first's first nameLetter]
     *      Example : "Johny Bob's first donNum was 54 (Was the the 54th donor)"
     *                 His code will be : JB54
     */

    public Donor(String name, String firstName, int age, String grouping, String[] adresse_given, int quantite) {
        super(name, firstName, age, grouping, adresse_given);
        this.quantite = quantite;
        this.motivation = true;

        //Filling DonorCard :
        this.donorCard[0] = name.charAt(0)+firstName.charAt(0)+this.getDonNum(); //Code B-)
        this.donorCard[1] = name;
        this.donorCard[2] = firstName;
    }

}


@@ -158,38 +158,8 @@
     
-private static int donNum = 0;
 %0A   
@@ -198,219 +198,27 @@
 te b
-oolean motivation;%0A   /* private Object donorCard%5B%5D = new Object%5B3%5D;// %5B%5Bint DonorKey%5D%7C%5BString email%5D%7C%5Bint telNumber%5D%5D //base de donn%C3%A9e ! pas besoin de ce tableau */%0A  private  String mail;%0A  private int numTel;
+yte motivation;%0A   
 %0A%0A  
@@ -224,32 +224,40 @@
    public Donor(
+int id, 
 String name, Str
@@ -393,422 +393,257 @@
 per(
-name, firstName, age, grouping, adresse);%0A        this.donNum++;%0A        this.quantite = quantite;%0A        this.motivation = motivation;%0A         this.mail=mail;%0A        this.numTel=numTel;%0A    %7D%0A%0A%0A    public void setGroupage (String gropage)%7B%0A        setGrouping(gropage);%0A        %0A%7D%0A    public String getGroupage()%7B%0A        return getGrouping();%0A%7D%0A%0A    public int getD
+ %0A            int id,%0A            String name, %0A            String firstName, %0A            int age, %0A            String grouping , %0A            Adresse adresse,%0A            String mail, %0A            int ph
 on
+e
 Num
-( )%7B%0A        return this.donNum
+ber,%0A            double poids)
 ;%0A      
  %0A  
@@ -642,72 +642,31 @@
     
- 
 %0A    
-%7D%0A%0A
     
-// HOw much he gives ?%0A    public void setQ
+this.q
 uantite 
 (int
@@ -661,20 +661,17 @@
 uantite 
-(int
+=
  quantit
@@ -675,41 +675,69 @@
 tite
-)%7B%0A
+;%0A   
     
+ 
 this.
-quantite=quantite;%0A%7D%0A
+motivation = motivation;%0A         %0A    %7D%0A%0A%0A   
 %0A   
@@ -804,18 +804,16 @@
   %7D%0A    
-  
 public v
@@ -823,24 +823,29 @@
  set
-Mail(String mail
+Quantite(int quantite
 )%7B%0A 
@@ -855,41 +855,46 @@
     
- 
 this.
-mail=mail
+quantite= quantite
 ;%0A    
+%7D%0A
      %0A 
-   %7D%0A
     
@@ -904,22 +904,26 @@
 lic 
-String getMail
+byte getMotivation
 ()%7B%0A
@@ -942,56 +942,84 @@
 urn 
-mail;%0A    %7D%0A    public void setNumTel(int numTel
+this.motivisation;%0A     %7D%0A    %0A    public void setMotivation(byte motivation
 )%7B%0A 
@@ -1029,93 +1029,46 @@
     
- 
 this.
-numTel=numTel;%0A    %7D%0A    public int getNumTel()%7B%0A         return numTel;
+motivation=motivation;%0A    %7D
 %0A    
-%7D%0A
 %0A%0A  
@@ -1397,24 +1397,26 @@
     */%0A%0A    
+/*
 public Donor
@@ -1842,13 +1842,48 @@
 e;%0A    %7D
+*/ //pourquoi tous ces contructeurs
 %0A%0A%7D%0A%0A

Update Donor.java