Exemplo n.º 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();
        }
Exemplo n.º 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);
            }
        }
Exemplo n.º 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);
            }
        }
Exemplo n.º 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();
        }
Exemplo n.º 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;
            }
        }
        public RemoveShipObserver(SceneState scenePlay)
        {
            this.pShip = null;

            this.scenePlay = scenePlay;
        }
Exemplo n.º 7
0
        public RemoveBombObserver(RemoveBombObserver b)
        {
            this.pBomb = b.pBomb;

            this.scenePlay = b.scenePlay;
        }
Exemplo n.º 8
0
        public RemoveBombObserver(SceneState scenePlay)
        {
            this.pBomb = null;

            this.scenePlay = scenePlay;
        }
 public ReCreateShipObserver(SceneState scenePlay)
 {
     this.scenePlay = scenePlay;
 }
Exemplo n.º 10
0
 public Scene()
 {
     this.state = null;
 }
Exemplo n.º 11
0
 public void SetState(SceneMan.State inState)
 {
     this.state = SceneMan.GetState(inState);
 }
        public RemoveAlienObserver(SceneState scenePlay)
        {
            this.pAlien = null;

            this.scenePlay = scenePlay;
        }