コード例 #1
0
 public void TestFirstAddedStateExists()
 {
     StateSystem stateSystem = new StateSystem();
     stateSystem.AddState("splash1", new SplashScreenState(stateSystem));
     stateSystem.AddState("splash2", new SplashScreenState(stateSystem));
     Assert.IsTrue(stateSystem.Exists("splash1"));
 }
コード例 #2
0
        public void TestFirstAddedStateExists()
        {
            StateSystem stateSystem = new StateSystem();

            stateSystem.AddState("splash1", new SplashScreenState(stateSystem));
            stateSystem.AddState("splash2", new SplashScreenState(stateSystem));
            Assert.IsTrue(stateSystem.Exists("splash1"));
        }
コード例 #3
0
        public void TestAddedStateExists()
        {
            StateSystem stateSystem = new StateSystem();
            stateSystem.AddState("splash", new SplashScreenState(stateSystem));

            // Does the added function now exist?
            Assert.IsTrue(stateSystem.Exists("splash"));
        }
コード例 #4
0
        public void TestAddedStateExists()
        {
            StateSystem stateSystem = new StateSystem();

            stateSystem.AddState("splash", new SplashScreenState(stateSystem));

            // Does the added function now exist?
            Assert.IsTrue(stateSystem.Exists("splash"));
        }
コード例 #5
0
 public void TestProcessSelectedState()
 {
     StateSystem stateSystem = new StateSystem();
     MockState mock = new MockState();
     stateSystem.AddState("mock", mock);
     stateSystem.ChangeState("mock");
     stateSystem.Update(0);
     Assert.IsTrue(mock.HasProcessBeenCalled);
 }
コード例 #6
0
        public void TestProcessSelectedState()
        {
            StateSystem stateSystem = new StateSystem();
            MockState   mock        = new MockState();

            stateSystem.AddState("mock", mock);
            stateSystem.ChangeState("mock");
            stateSystem.Update(0);
            Assert.IsTrue(mock.HasProcessBeenCalled);
        }
コード例 #7
0
        public void TestRenderNoSelectedState()
        {
            StateSystem stateSystem = new StateSystem();
            MockState   mock        = new MockState();

            stateSystem.AddState("mock", mock);
            stateSystem.Render();
            // State wasn't changed to mock so it shouldn't be
            // rendered.
            Assert.IsFalse(mock.HasRenderBeenCalled);
        }
コード例 #8
0
        public void TestProcessNoSelectedState()
        {
            StateSystem stateSystem = new StateSystem();
            MockState   mock        = new MockState();

            stateSystem.AddState("mock", mock);
            stateSystem.Update(0);
            // State wasn't changed to mock so it shouldn't be
            // processed.
            Assert.IsFalse(mock.HasProcessBeenCalled);
        }
コード例 #9
0
 public void TestRenderSelectedState()
 {
     StateSystem stateSystem = new StateSystem();
     MockState mock = new MockState();
     stateSystem.AddState("mock", mock);
     stateSystem.ChangeState("mock");
     stateSystem.Render();
     // State wasn't changed to mock so it shouldn't be 
     // rendered.
     Assert.IsTrue(mock.HasRenderBeenCalled);
 }
コード例 #10
0
        public void TestChangeStates()
        {
            StateSystem stateSystem = new StateSystem();
            MockState   mock1       = new MockState();
            MockState   mock2       = new MockState();

            stateSystem.AddState("mock1", mock1);
            stateSystem.AddState("mock2", mock2);
            stateSystem.ChangeState("mock1");
            stateSystem.ChangeState("mock2");
            stateSystem.Render();
            // State wasn't changed to mock so it shouldn't be
            // rendered.
            Assert.IsFalse(mock1.HasRenderBeenCalled);
            Assert.IsTrue(mock2.HasRenderBeenCalled);
        }
コード例 #11
0
 public void TestProcessNoSelectedState()
 {
     StateSystem stateSystem = new StateSystem();
     MockState mock = new MockState();
     stateSystem.AddState("mock", mock);
     stateSystem.Update(0);
     // State wasn't changed to mock so it shouldn't be 
     // processed.
     Assert.IsFalse(mock.HasProcessBeenCalled);
 }
コード例 #12
0
 public void TestChangeStates()
 {
     StateSystem stateSystem = new StateSystem();
     MockState mock1 = new MockState();
     MockState mock2 = new MockState();
     stateSystem.AddState("mock1", mock1);
     stateSystem.AddState("mock2", mock2);
     stateSystem.ChangeState("mock1");
     stateSystem.ChangeState("mock2");
     stateSystem.Render();
     // State wasn't changed to mock so it shouldn't be 
     // rendered.
     Assert.IsFalse(mock1.HasRenderBeenCalled);
     Assert.IsTrue(mock2.HasRenderBeenCalled);
 }
コード例 #13
0
 public SplashScreenState(StateSystem system)
 {
     _system = system;
 }
コード例 #14
0
 public SplashScreenState(StateSystem system)
 {
     _system = system;
 }