public override bool OnMessage(Miner entity, Telegram telegram) { MessageReader.MessageType msg = (MessageReader.MessageType)telegram.Msg; switch (msg) { case MessageReader.MessageType.Msg_StewReady: Debug.Log("Message handled by " + EntityNames.GetNameOfEntity(entity.ID) + " at time: " + Time.time); Debug.Log(EntityNames.GetNameOfEntity(entity.ID) + ": Okay, Hun, ahm a comin'!"); entity.FSM.ChangeState(entity.GetMinerState(Miner.StateMinerType.StateEatStew)); return(true); } return(false); }
public override bool OnMessage(MinerWife entity, Telegram telegram) { MessageReader.MessageType msg = (MessageReader.MessageType)telegram.Msg; switch (msg) { case MessageReader.MessageType.Msg_HiHoneyImHome: Debug.Log("Message handled by " + EntityNames.GetNameOfEntity(entity.ID) + " at time: " + Time.time); Debug.Log(EntityNames.GetNameOfEntity(entity.ID) + ": Hi honey. Let me make you some of mah fine " + "country stew"); entity.FSM.ChangeState(entity.GetMinerWifeState(MinerWife.StateMinerWifeType.StateCookStew)); return(true); } return(false); }
public override bool OnMessage(MinerWife entity, Telegram telegram) { MessageReader.MessageType msg = (MessageReader.MessageType)telegram.Msg; switch (msg) { case MessageReader.MessageType.Msg_StewReady: Debug.Log("Message received by " + EntityNames.GetNameOfEntity(entity.ID) + " at time: " + Time.time); MessageDispatcher.Instance.DispatchMessage(MessageDispatcher.SEND_MSG_IMMEDIATELY, entity.ID, (int)EntityNames.EntityName.Miner_Bob, (int)MessageReader.MessageType.Msg_StewReady, MessageDispatcher.NO_ADDITIONAL_INFO); entity.Cooking = false; entity.FSM.ChangeState(entity.GetMinerWifeState(MinerWife.StateMinerWifeType.StateDoHousework)); return(true); } return(false); }