Exemplo n.º 1
0
        public void Test_New()
        {
            var fc = new ClockTower ();

            Assert.AreEqual (0, fc.CurrentTime);
            Assert.AreEqual (0, fc.PreviousTime);
            Assert.AreEqual (0, fc.DeltaTime);
            Assert.AreEqual (0, fc.FrameCount);
            Assert.AreEqual (0, fc.FrameRate);
        }
Exemplo n.º 2
0
	public void Main()
	{
		// Do your work here...
		ClockTower myTower = new ClockTower(1000);

		myTower.OnChime += new ClockTower.ChimeEventHandler(my_OnChime);

		// Keep the main thread alive long enough to observe the event.
		Thread.Sleep(3000);
	}
Exemplo n.º 3
0
        public void Test_GetTime()
        {
            var fc = new ClockTower ();

            fc.OnUpdate (33);
            fc.OnUpdate (66);
            fc.OnUpdate (100);

            Assert.AreEqual (100, fc.CurrentTime);
            Assert.AreEqual (66, fc.PreviousTime);
            Assert.AreEqual (34, fc.DeltaTime);
            Assert.AreEqual (3, fc.FrameCount);
        }
Exemplo n.º 4
0
        public void Test_GetFrameRate()
        {
            var fc = new ClockTower ();

            fc.OnUpdate (500);
            fc.OnUpdate (1000);
            Assert.AreEqual (2, fc.FrameRate);

            fc.OnUpdate (1500);
            fc.OnUpdate (1600);
            fc.OnUpdate (2000);
            Assert.AreEqual (3, fc.FrameRate);
        }
Exemplo n.º 5
0
 public Test()
 {
     clock  = new ClockTower();
     person = new Person(clock);
 }