예제 #1
0
 public override void OnStateExit()
 {
     _specialCaseForNextRound = new SpecialCaseState(null, NextStatePriority.Default);
     foreach (var pocket in Pockets)
     {
         Pockets.SetPocketHighlightState(pocket, false);
     }
 }
예제 #2
0
        private IEnumerator <YieldInstruction> EnterCoRoutine(GameState previous)
        {
            for (int n = 0; n < 3; n++)
            {
                yield return(null);
            }

            StateMachine.Mode.TurnEnded();
            if (StateMachine.Mode.DeathBallShotAllowed(StateMachine.Mode.CurrentPlayer))
            {
                SpecialCaseForNextRound = new SpecialCaseState(callPocketState, NextStatePriority.CallPocket);
            }

            if (SpecialCaseForNextRound.State != null)
            {
                StateMachine.Current = SpecialCaseForNextRound.State;
            }
            else
            {
                StateMachine.Current = DefaultNextState;
            }
        }
예제 #3
0
#pragma warning restore 649

        /// <summary>
        /// Specify the GameState that will be set at the beginning of next round. This only applies to the very next round, after which
        /// the current TurnEndGameState will revert to its default value.
        /// </summary>
        /// <param name="state"></param>
        public void SetStartingStateForNextRound(GameState state, NextStatePriority priority)
        {
            SpecialCaseForNextRound = new SpecialCaseState(state, priority);
        }