public Game(Motel motel, GameSpeed speed) //gets gameSpeed { vMotel = motel; RefreshRate = (int)speed; vEngine = new Engine(vMotel.GetRooms().ElementAt(0), 2318); //gets the use of engine and the ID for the engine vGameOver = false; }
public void TickTock(Object data) // allows this function to then be used in the program class to allow the game to tick for rooms to burn { foreach (Location room in vMotel.GetRooms()) { if (room.GetType() == typeof(Room)) { ((Room)room).OnTick(); //allows the rooms to tick so they can get hotter from the fire } } vEngine.OnTick(); if (vMotel.GameOver() == true) { vGameOver = true; //get final results End(); } }
public void TickTock(Object data) { //Console.WriteLine("The Next Tick"); foreach (Location room in vMotel.GetRooms()) { if (room.GetType() == typeof(Room)) { ((Room)room).GetNeighbors(); ((Room)room).OnTick(); } } }