Exemplo n.º 1
0
        public void Step(ref ForcedRecoveryStepState token, int condition)
        {
            ModalEV modal = modalService.FindModalEV(entitiesDB);

            SetModalData(token, modal);
            modalService.DisplayModal(modal);
        }
Exemplo n.º 2
0
        public void Step(ref TierExchangeStepState token, int condition)
        {
            ModalEV modal = modalService.FindModalEV(entitiesDB);

            SetModalOptions(modal, ref token);
            modalService.DisplayModal(modal);
        }
Exemplo n.º 3
0
        public void Step(ref ClickImmobileCaptureStepState token, int condition)
        {
            ModalEV modal = modalService.FindModalEV(entitiesDB);

            SetModalOptions(modal, ref token);
            modalService.DisplayModal(modal);
        }
        private void OnPressed(int entityId, PieceSide answer)
        {
            ModalEV modal = modalService.FindModalEV(entitiesDB);

            modal.Visibility.IsVisible.value = false; // Forcibly close confirm modal
            NextAction(modal, answer);
        }
        public void Step(ref ImmobileCaptureStepState token, int condition)
        {
            ModalEV modal = modalService.FindModalEV(entitiesDB);

            SetModalOptions(modal);
            UpdateModalView(modal);
        }
        private void NextActionCapture()
        {
            ModalEV modal                     = modalService.FindModalEV(entitiesDB);
            TileEV  destinationTile           = FindDestinationTile(modal);
            PieceEV topPieceAtDestinationTile = pieceFindService.FindTopPieceByLocation(
                destinationTile.Location.Location, entitiesDB).Value;
            PieceEV pieceToMove = FindPieceToMove(destinationTile);

            var captureToken = new CapturePieceStepState
            {
                PieceToCapture  = topPieceAtDestinationTile,
                PieceToMove     = pieceToMove,
                DestinationTile = destinationTile
            };

            captureStackModalAnswerSequence.Next(this, ref captureToken, (int)MoveState.MOBILE_CAPTURE);
        }
        public void Step(ref CheckmateModalStepState token, int condition)
        {
            ModalEV     modal            = modalService.FindModalEV(entitiesDB);
            TurnEV      currentTurn      = turnService.GetCurrentTurnEV(entitiesDB);
            PlayerColor victoriousPlayer = TurnService.CalcOtherTurnPlayer(currentTurn.TurnPlayer.PlayerColor);

            SetModalOptions(modal, victoriousPlayer);
            modalService.DisplayModal(modal);
        }
Exemplo n.º 8
0
        public void Step(ref ClickPieceStepState token, int condition)
        {
            ModalEV        modal            = modalService.FindModalEV(entitiesDB);
            List <PieceEV> piecesAtLocation = pieceFindService.FindPiecesByLocation(
                token.ClickedPiece.Location.Location, entitiesDB);

            SetModalOptions(modal, piecesAtLocation);
            modalService.DisplayModal(modal);
        }
        private void OnPressed(int entityId, bool cancel)
        {
            ModalEV modal = modalService.FindModalEV(entitiesDB);
            bool    continueCancelling = modal.Type.Type != ModalType.CONFIRM ||
                                         modal.Type.Type != ModalType.TOWER_3RD_TIER;

            var token = new CancelModalStepState();

            cancelModalSequence.Next(this, ref token, (int)(continueCancelling ? StepAB.A : StepAB.B));
        }
        private TowerAnswerState DecideNextAction(PieceEV piece)
        {
            TowerAnswerState returnValue = TowerAnswerState.CLICK_HIGHLIGHT;
            ModalEV          modal       = modalService.FindModalEV(entitiesDB);

            if (!piece.Tier.TopOfTower)
            {
                returnValue = TowerAnswerState.DESIGNATE_IMMOBILE_CAPTURE;
            }
            // It's possible to click non-topOfTower piece while immobile capture designated, hence the override
            if (modal.ImmobileCaptureState.ImmobileCaptureDesignated)
            {
                returnValue = TowerAnswerState.INITIATE_IMMOBILE_CAPTURE;
            }

            return(returnValue);
        }