Пример #1
0
 public void SearchFood(int time)
 {
     for (var i = 0; i < time; i++)
     {
         _state = _energyDecrementModifierModifier.Modify(_state);
     }
 }
Пример #2
0
 public Tamagotchi(State state, IStateModifier energyDecrementModifierModifier, IStateModifier timeModifier,
     IDictionary<Food, IStateModifier> foodReaction)
 {
     _state = state;
     _energyDecrementModifierModifier = energyDecrementModifierModifier;
     _timeModifier = timeModifier;
     _foodReaction = foodReaction;
 }
Пример #3
0
 public void TimeDec()
 {
     _state = _timeModifier.Modify(_state);
 }
Пример #4
0
 public void PushFood(Food food)
 {
     _state = _foodReaction[food].Modify(_state);
     Console.WriteLine("Food  " + food.Name + " is eaten");
 }