public void TriggerEvent(ValueType _event) { if (_event is CommandChangeResultPos) { CommandChangeResultPos command = (CommandChangeResultPos)_event; GetCommandChangeResultPos(command); } else if (_event is CommandChangeWorkerPos) { CommandChangeWorkerPos command = (CommandChangeWorkerPos)_event; GetCommandChangeWorkerPos(command); } else if (_event is CommandCompleteDish) { CommandCompleteDish command = (CommandCompleteDish)_event; GetCommandCompleteDish(command); } else if (_event is CommandCompleteRequirement) { CommandCompleteRequirement command = (CommandCompleteRequirement)_event; GetCommandCompleteRequirement(command); } }
public void CompleteDish(CommandCompleteDish _command) { Dish dish = dishList[_command.pos]; if (_command.targetPos != -1) { DishResultContainer dishResultContainer = dishResultContainerArr[_command.targetPos]; dishResultContainer.SetResult(dish.resultUnit); dish.RemoveDishResult(); } else { dish.DestroyDishResult(); } }
private void GetCommandCompleteDish(CommandCompleteDish _command) { PlayerDataUnit unit = _command.isMine == client.clientIsMine ? mPlayerData : oPlayerData; unit.CompleteDish(_command); }