public void ChangeResultPos(CommandChangeResultPos _command) { DishResultContainer dishResultContainer = dishResultContainerArr[_command.pos]; if (_command.targetPos == -1) { dishResultContainer.Clear(); } else { DishResultContainer targetDishResultContainer = dishResultContainerArr[_command.targetPos]; if (targetDishResultContainer.result == null) { targetDishResultContainer.SetResult(dishResultContainer.result); dishResultContainer.SetResult(null); } else { DishResultUnit tmpDishResult = targetDishResultContainer.result; targetDishResultContainer.SetResult(dishResultContainer.result); dishResultContainer.SetResult(tmpDishResult); } } }
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); } }
private void GetCommandChangeResultPos(CommandChangeResultPos _command) { PlayerDataUnit unit = _command.isMine == client.clientIsMine ? mPlayerData : oPlayerData; unit.ChangeResultPos(_command); }