// INTERFACE public void SetLifeStrategy(int randNumber) { if ((randNumber % 2) == 0) { Console.WriteLine("Votre tama est heureux !"); lifeStrategy = new HappyLifeStrategy(); } else { Console.WriteLine("Oh non... Votre tama est triste..."); lifeStrategy = new SadLifeStrategy(); } }
public Tama(int nbPointsDeVie, int nbPointsDeRessources, ILifeStrategy lifeStrategy) { nbPointsDeRessources = this.nbPointsDeRessources; nbPointsDeVie = this.nbPointsDeVie; lifeStrategy = this.lifeStrategy; }