package villageSchtroumpf;

public class Schtroumpf{

    int kiloSalsepareille;
    boolean presenceGargamel = false;
    String nom;

    public String getNom(){
	return nom;
    }

    public Schtroumpf(String nom, int ks){

	this.nom = nom;
	System.out.println("je suis le Schtroumpf "+ nom);

	System.out.println("etape a");	
	kiloSalsepareille = ks;
	System.out.println("etape b");
    }

    public void voirGargamel(){
	presenceGargamel = true;
	System.out.println("je suis le Schtroumpf "+ nom+ " et je vois Gargamel ! Au Sechtroumpf!");

    }

    public void gargamelSenVa(){
	System.out.println("etape 3");
	String texteSChantant = "Youpi, Gargamel s'en va !";
	System.out.println("etape 4");
	presenceGargamel = false;
	System.out.println("etape 5");
	System.out.println("Le Schtroumpf chantant chante : "+ texteSChantant);
    }

    public void acheterSalsepareille(int ks){
	kiloSalsepareille += ks;
    }

    public void donnerSalsepareille(Schtroumpf s, int sp){

		System.out.println("je suis le Schtroumpf "+ nom + " et je veux donner "+ sp +" kilos de Salsepareille au Schtroumpf "+ s.getNom());

	if(sp > kiloSalsepareille) System.out.println("Nom d'un Schtroumpf, je n'ai pas assez de salsepareille pour schtroupmfer un cadeau à mon copain Schtroumpf !");
	else
	    kiloSalsepareille -= sp;
	s.addSalsepareille(sp);
    }

    public void addSalsepareille(int sp){

	kiloSalsepareille += sp;
	System.out.println("je suis le Schtroumpf "+ nom + " et j'ai gagné "+sp + " kilos de Salsepareille");

    }

}
