public override void Execute(Miner t) { if (t.ThrstyToBar()) { t.GetStateMachine().ChangeState(StateBar.Instance()); } if (t.TiredtoHome()) { t.GetStateMachine().ChangeState(StateHome.Instance()); } }
public override void INIT(int id) { base.INIT(id); iGold = 0; iThirst = 10; iTired = 10; iBankMoney = 0; eLocation = MAGADATA.LocationType.HOME; mStateMachine = new StateMachine <Miner>(this); mStateMachine.SetCurrentState(StateHome.Instance()); mStateMachine.SetGlobalState(StateGlobal.Instance()); }