示例#1
0
    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);
            }
        }
    }
示例#2
0
    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);
        }
    }
示例#3
0
    private void GetCommandChangeResultPos(CommandChangeResultPos _command)
    {
        PlayerDataUnit unit = _command.isMine == client.clientIsMine ? mPlayerData : oPlayerData;

        unit.ChangeResultPos(_command);
    }