public void CheckBoredom() { if (PetBoredom > 0) { if (PetPlaying) { //do nada } else { State = new Playing(this); PetPlaying = true; } } else//pet has played enough { EndPlay(); } }//end CheckTiredness
}// end method CallStateOLD public void CallStateALSOOLD() { if (PetHunger > 0) //pet has reached petNeedToEatFrame // at least once { if (PetEating) { State.Eat(); } else { State = new Eating(this); State.Eat(); } } if (PetThirst > 0) //pet has reached petNeedToDrinkFrame // at least once { if (PetDrinking) { State.Drink(); } else { State = new Drinking(this); State.Drink(); } } if (PetTired > 0) //pet has reached petNeedToDrinkFrame // at least once { if (PetSleeping) { State.Sleep(); } else { State = new Sleeping(this); State.Sleep(); } } if (PetBoredom > 0) //pet has reached petNeedToDrinkFrame // at least once { if (PetPlaying) { State.Play(); } else { State = new Playing(this); State.Play(); } } if (PetLonely > 0) //pet has reached petNeedToDrinkFrame // at least once { if (PetHugging) { State.ReceiveAffection(); } else { State = new Affectioning(this); State.ReceiveAffection(); } } }//end of callstatealsoold