Exemplo n.º 1
0
 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;
 }
Exemplo n.º 2
0
 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();
     }
 }
Exemplo n.º 3
0
 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();
         }
     }
 }