Exemple #1
0
        /// <summary>
        /// Vaihtaa seuraavan staten.
        /// </summary>
        private void ChangeState()
        {
            if (!Finished && nextMapState == null)
            {
                MapState lastMapState = currentMapState;

                // Jos on jo state, otetaan seuraava vain talteen.
                if (currentMapState != null)
                {
                    nextMapState = GetNextState();
                }
                else
                {
                    // Jos meillä ei ole state, tulee toisto aloittaa.
                    currentMapState = GetNextState();
                    currentMapState.Start();
                }

                if (lastMapState != null && lastMapState.Finished)
                {
                    if (OnStateFinished != null)
                    {
                        OnStateFinished(this, new MapStateManagerEventArgs(lastMapState, nextMapState));
                    }
                }
            }
        }
Exemple #2
0
        /// <summary>
        /// Jos quessa on seuraava state, asettaa sen aktiiviseksi.
        /// </summary>
        public void ChangeNextState()
        {
            currentMapState = nextMapState;
            nextMapState = null;

            currentMapState.Start();
        }
Exemple #3
0
        /// <summary>
        /// Jos quessa on seuraava state, asettaa sen aktiiviseksi.
        /// </summary>
        public void ChangeNextState()
        {
            currentMapState = nextMapState;
            nextMapState    = null;

            currentMapState.Start();
        }
Exemple #4
0
        /// <summary>
        /// Vaihtaa seuraavan staten.
        /// </summary>
        private void ChangeState()
        {
            if (!Finished && nextMapState == null)
            {
                MapState lastMapState = currentMapState;

                // Jos on jo state, otetaan seuraava vain talteen.
                if (currentMapState != null)
                {
                    nextMapState = GetNextState();
                }
                else
                {
                    // Jos meillä ei ole state, tulee toisto aloittaa.
                    currentMapState = GetNextState();
                    currentMapState.Start();
                }

                if (lastMapState != null && lastMapState.Finished)
                {
                    if (OnStateFinished != null)
                    {
                        OnStateFinished(this, new MapStateManagerEventArgs(lastMapState, nextMapState));
                    }
                }
            }
        }