コード例 #1
0
        //----------------------------------------------------------------------------------
        // Constructor
        //----------------------------------------------------------------------------------
        public SceneContext()
        {
            // reserve the states
            this.poSceneSelect   = new SceneSelect();
            this.poSceneDemo     = new SceneDemo();
            this.poScenePlay     = new ScenePlay();
            this.poSceneGameOver = new SceneGameOver();

            // initialize to the select state
            this.pSceneState = this.poSceneSelect;
            this.pSceneState.Entering();
        }
コード例 #2
0
        public override void Notify()
        {
            SceneContext pSceneContext = SceneContext.GetInstance();

            Debug.Assert(pSceneContext != null);

            SceneState sceneState = pSceneContext.GetState();

            if (pSceneContext.poScenePlayer2.numLives > 1)
            {
                pSceneContext.SetState(SceneContext.Scene.Player2);
            }
        }
コード例 #3
0
        public override void Notify()
        {
            SceneContext pSceneContext = SceneContext.GetInstance();

            Debug.Assert(pSceneContext != null);

            SceneState sceneState = pSceneContext.GetState();

            if (sceneState.name == SceneContext.Scene.Over)
            {
                pSceneContext.SetState(SceneContext.Scene.Select);
            }
        }
コード例 #4
0
        public SceneContext()
        {
            // reserve the states
            this.poSceneSelect       = new SceneSelect();
            this.poScenePlayerSelect = new ScenePlayerSelect();
            this.poScenePlay         = new ScenePlay();
            this.poScenePlay2        = new ScenePlay2();
            this.poSceneOver         = new SceneOver();

            // initialize to the select state
            this.pSceneState = this.poSceneSelect;
            this.pSceneState.Transition();
        }
コード例 #5
0
        public void SetState(Scene eScene)
        {
            switch (eScene)
            {
            case Scene.Select:
                this.pSceneState.Leaving();
                this.pSceneState = this.poSceneSelect;
                this.pSceneState.Entering();
                break;


            case Scene.Demo:
                this.pSceneState.Leaving();
                this.pSceneState = this.poSceneDemo;
                this.pSceneState.Entering();
                break;


            case Scene.Play:
                this.pSceneState.Leaving();
                this.pSceneState = this.poScenePlay;
                this.pSceneState.Entering();
                break;


            case Scene.GameOver:
                this.pSceneState.Leaving();
                this.pSceneState = this.poSceneGameOver;
                this.pSceneState.Entering();
                break;

            case Scene.Default:
                Debug.WriteLine("The state your are looking for is Not Defined...");
                Debug.Assert(false);
                break;
            }
        }
コード例 #6
0
        public RemoveShipObserver(SceneState scenePlay)
        {
            this.pShip = null;

            this.scenePlay = scenePlay;
        }
コード例 #7
0
        public RemoveBombObserver(RemoveBombObserver b)
        {
            this.pBomb = b.pBomb;

            this.scenePlay = b.scenePlay;
        }
コード例 #8
0
        public RemoveBombObserver(SceneState scenePlay)
        {
            this.pBomb = null;

            this.scenePlay = scenePlay;
        }
コード例 #9
0
 public ReCreateShipObserver(SceneState scenePlay)
 {
     this.scenePlay = scenePlay;
 }
コード例 #10
0
 public Scene()
 {
     this.state = null;
 }
コード例 #11
0
 public void SetState(SceneMan.State inState)
 {
     this.state = SceneMan.GetState(inState);
 }
コード例 #12
0
        public RemoveAlienObserver(SceneState scenePlay)
        {
            this.pAlien = null;

            this.scenePlay = scenePlay;
        }