Пример #1
0
    bool SetState(ScarabUIState newState)
    {
        bool bSuccess = false;

        switch (newState)
        {
        default:
        case ScarabUIState.ready:
            selectedDie = null;
            bSuccess    = true;
            SetNumScarabsUI();
            break;

        //  try to use the scarab
        case ScarabUIState.scarab_activated:
            //  set aside the scarab for use
            if (GameState.GetCurrentGameState().currentPlayer.UseScarab(type))
            {
                if (SetState(ScarabUIState.waiting_die_select))
                {
                    bSuccess = true;
                    newState = ScarabUIState.waiting_die_select;
                }
            }
            break;

        case ScarabUIState.waiting_die_select:
            //GameState.GetCurrentGameState().currentPlayer.AskToChooseDie(this.type.ToString());
            //GameState.Message(this.name + " please select a die for scarab action");
            bSuccess = true;
            break;
        }
        if (bSuccess)
        {
            scuiState = newState;
        }
        return(bSuccess);
    }
Пример #2
0
    bool SetState(ScarabUIState newState)
    {
        bool bSuccess = false;
        switch (newState)
        {
            default:
            case ScarabUIState.ready:
                selectedDie = null;
                bSuccess = true;
                SetNumScarabsUI();
                break;

            //  try to use the scarab
            case ScarabUIState.scarab_activated:
                //  set aside the scarab for use
                if (GameState.GetCurrentGameState().currentPlayer.UseScarab(type)) {
                    if (SetState(ScarabUIState.waiting_die_select))
                    {
                        bSuccess = true;
                        newState = ScarabUIState.waiting_die_select;
                    }
                }
                break;
            case ScarabUIState.waiting_die_select:
                //GameState.GetCurrentGameState().currentPlayer.AskToChooseDie(this.type.ToString());
                //GameState.Message(this.name + " please select a die for scarab action");
                bSuccess = true;
                break;
        }
        if (bSuccess)
        {
            scuiState = newState;
        }
        return bSuccess;
    }