Ejemplo n.º 1
0
    public void ChangeStatus(WorkerPriorityView view, bool isWork)
    {
        if (characterData == null || characterData.baseInfo == null)
        {
            return;
        }
        //厨师状态
        if (view == wvChef)
        {
            CharacterWorkerBaseBean characterWorker = characterData.baseInfo.GetWorkerInfoByType(WorkerEnum.Chef);
            characterWorker.SetWorkStatus(isWork);
        }
        //伙计状态
        else if (view == wvWaiterForSend)
        {
            CharacterWorkerForWaiterBean characterWorker = (CharacterWorkerForWaiterBean)characterData.baseInfo.GetWorkerInfoByType(WorkerEnum.Waiter);
            characterWorker.SetWorkStatusForSend(isWork);
        }
        else if (view == wvWaiterForCleanTable)
        {
            CharacterWorkerForWaiterBean characterWorker = (CharacterWorkerForWaiterBean)characterData.baseInfo.GetWorkerInfoByType(WorkerEnum.Waiter);
            characterWorker.SetWorkStatusForCleanTable(isWork);
        }
        else if (view == wvWaiterForCleanBed)
        {
            CharacterWorkerForWaiterBean characterWorker = (CharacterWorkerForWaiterBean)characterData.baseInfo.GetWorkerInfoByType(WorkerEnum.Waiter);
            characterWorker.SetWorkStatusForCleanBed(isWork);
        }
        //账房状态
        else if (view == wvAccounting)
        {
            CharacterWorkerBaseBean characterWorker = characterData.baseInfo.GetWorkerInfoByType(WorkerEnum.Accountant);
            characterWorker.SetWorkStatus(isWork);
        }
        //接待状态
        else if (view == wvAccostForSolicit)
        {
            CharacterWorkerForAccostBean characterWorker = (CharacterWorkerForAccostBean)characterData.baseInfo.GetWorkerInfoByType(WorkerEnum.Accost);
            characterWorker.SetWorkStatusForSolicit(isWork);
        }
        else if (view == wvAccostForGuide)
        {
            CharacterWorkerForAccostBean characterWorker = (CharacterWorkerForAccostBean)characterData.baseInfo.GetWorkerInfoByType(WorkerEnum.Accost);
            characterWorker.SetWorkStatusForGuide(isWork);
        }
        //打手状态
        else if (view == wvBeater)
        {
            CharacterWorkerBaseBean characterWorker = characterData.baseInfo.GetWorkerInfoByType(WorkerEnum.Beater);
            characterWorker.SetWorkStatus(isWork);
        }

        AudioHandler.Instance.PlaySound(AudioSoundEnum.ButtonForNormal);

        InnHandler.Instance.InitWorker();
    }
Ejemplo n.º 2
0
    public void ChangePriority(WorkerPriorityView view, int priority)
    {
        //厨师优先级
        if (view == wvChef)
        {
            CharacterWorkerBaseBean characterWorker = characterData.baseInfo.GetWorkerInfoByType(WorkerEnum.Chef);
            characterWorker.SetPriority(priority);
        }
        //伙计优先级
        else if (view == wvWaiterForSend)
        {
            CharacterWorkerForWaiterBean characterWorker = (CharacterWorkerForWaiterBean)characterData.baseInfo.GetWorkerInfoByType(WorkerEnum.Waiter);
            characterWorker.SetPriorityForSend(priority);
        }
        else if (view == wvWaiterForCleanTable)
        {
            CharacterWorkerForWaiterBean characterWorker = (CharacterWorkerForWaiterBean)characterData.baseInfo.GetWorkerInfoByType(WorkerEnum.Waiter);
            characterWorker.SetPriorityForCleanTable(priority);
        }
        else if (view == wvWaiterForCleanBed)
        {
            CharacterWorkerForWaiterBean characterWorker = (CharacterWorkerForWaiterBean)characterData.baseInfo.GetWorkerInfoByType(WorkerEnum.Waiter);
            characterWorker.SetPriorityForCleanBed(priority);
        }
        //账房优先级
        else if (view == wvAccounting)
        {
            CharacterWorkerBaseBean characterWorker = characterData.baseInfo.GetWorkerInfoByType(WorkerEnum.Accountant);
            characterWorker.SetPriority(priority);
        }
        //接待优先级
        else if (view == wvAccostForSolicit)
        {
            CharacterWorkerForAccostBean characterWorker = (CharacterWorkerForAccostBean)characterData.baseInfo.GetWorkerInfoByType(WorkerEnum.Accost);
            characterWorker.SetPriorityForSolicit(priority);
        }
        else if (view == wvAccostForGuide)
        {
            CharacterWorkerForAccostBean characterWorker = (CharacterWorkerForAccostBean)characterData.baseInfo.GetWorkerInfoByType(WorkerEnum.Accost);
            characterWorker.SetPriorityForGuide(priority);
        }
        //打手优先级
        else if (view == wvBeater)
        {
            CharacterWorkerBaseBean characterWorker = characterData.baseInfo.GetWorkerInfoByType(WorkerEnum.Beater);
            characterWorker.SetPriority(priority);
        }

        InnHandler.Instance.InitWorker();
    }