Пример #1
0
    public void UpdateUIStateMain()
    {
        bool anyTurning = false;
        bool allLegal   = true;

        foreach (Piece piece in CurrentPlayer.pieces)
        {
            anyTurning |= piece.IsRotating();
            allLegal   &= IsValidPosition(piece);
        }

        bool hasTurned = currentSelectedPiece != null && currentSelectedPiece.IsRotated();

        //if (anyTurning || currentSelectedPiece == null)
        //    UIState.SetGroupState(UIStates.Group.PieceControls, UIStates.State.Disabled);
        //else
        //    UIState.SetGroupState(UIStates.Group.PieceControls, UIStates.State.Active);
        if (lastSelectedPiece != null || hasTurned)
        {
            UIStates.SetGroupState(UIStates.Group.Undo, UIStates.State.Active);
        }
        else
        {
            UIStates.SetGroupState(UIStates.Group.Undo, UIStates.State.Disabled);
        }

        //if (allLegal && !anyTurning && hasTurned)
        //    UIState.SetGroupState(UIStates.Group.EndTurn, UIStates.State.Active);
        //else
        //    UIState.SetGroupState(UIStates.Group.EndTurn, UIStates.State.Disabled);
    }
Пример #2
0
    protected override void OnEnter()
    {
        UIStates.SetGroupState(UIStates.Group.PieceControls, UIStates.State.Hidden);
        UIStates.SetGroupState(UIStates.Group.EndGame, UIStates.State.Hidden);
        UIStates.SetGroupState(UIStates.Group.PuzzleSelection, UIStates.State.Hidden);

        AddListeners(new List <ESignalType> {
            ESignalType.SetupComplete
        });

        Game.currentGame.StartSetup();
    }
Пример #3
0
    protected override void OnEnter()
    {
        AddListeners(new List <ESignalType> {
            ESignalType.StartPuzzle, ESignalType.Quit
        });
        AddListenersOne(new List <ESignalType> {
            ESignalType.StartPuzzle
        });

        UIStates.SetGroupState(UIStates.Group.EndGame, UIStates.State.Hidden);
        UIStates.SetGroupState(UIStates.Group.EndTurn, UIStates.State.Hidden);
        UIStates.SetGroupState(UIStates.Group.PuzzleSelection, UIStates.State.Active);
    }
Пример #4
0
    protected override void OnEnter()
    {
        UIStates.SetGroupState(UIStates.Group.EndGame, UIStates.State.Active);
        UIStates.SetGroupState(UIStates.Group.PieceControls, UIStates.State.Disabled);
        UIStates.SetGroupState(UIStates.Group.Undo, UIStates.State.Disabled);

        AddListeners(new List <ESignalType> {
            ESignalType.StartPuzzle, ESignalType.SelectBoard, ESignalType.Quit
        });

        Game.currentGame.SetPieceModeEnd();
        foreach (Player player in Game.currentGame.players)
        {
            player.SetActivePlayer(false);
        }
    }
Пример #5
0
    protected override void OnEnter()
    {
        UIStates.SetGroupState(UIStates.Group.PieceControls, UIStates.State.Active);

        AddListeners(new List <ESignalType> {
            ESignalType.Quit,
            ESignalType.RotateCCW,
            ESignalType.RotateUndo,
            ESignalType.RotateCW,
            ESignalType.EndTurn,
            ESignalType.Restart
        });

        AddListenersOne(new List <ESignalType> {
            ESignalType.PuzzleComplete
        });

        Game.currentGame.StartMain();
    }
Пример #6
0
    protected override void OnSignal(ESignalType signalType)
    {
        switch (signalType)
        {
        case ESignalType.StartPuzzle:
            UIStates.SetGroupState(UIStates.Group.EndGame, UIStates.State.Hidden);
            Game.SelectGame();
            SMTransition(signalType);
            break;

        case ESignalType.SelectBoard:
            UIStates.SetGroupState(UIStates.Group.EndGame, UIStates.State.Hidden);
            SMTransition(signalType);
            break;

        case ESignalType.Quit:
            SMTransition(signalType);
            break;
        }
    }