//---------------------------------------------------------------------------------- // 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(); }
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); } }
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); } }
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(); }
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; }
public RemoveBombObserver(RemoveBombObserver b) { this.pBomb = b.pBomb; this.scenePlay = b.scenePlay; }
public RemoveBombObserver(SceneState scenePlay) { this.pBomb = null; this.scenePlay = scenePlay; }
public ReCreateShipObserver(SceneState scenePlay) { this.scenePlay = scenePlay; }
public Scene() { this.state = null; }
public void SetState(SceneMan.State inState) { this.state = SceneMan.GetState(inState); }
public RemoveAlienObserver(SceneState scenePlay) { this.pAlien = null; this.scenePlay = scenePlay; }