Exemplo n.º 1
0
        public SimulationForm(string fileLocation, Settings settings)
        {
            InitializeComponent();

            ImportLayout import = new ImportLayout();

            import.LayoutImport(fileLocation);

            Hotel.Settings = settings;


            Graph.CreateGraph();

            Hotel.Reception.HireCleaners(Hotel.Settings.CleanerAmount);

            _BackgroundBuffer = new Bitmap(Hotel.Floors[0].Areas.Length * 60 + 1, Hotel.Floors.Length * 55 + 1);
            _ForegroundBuffer = new Bitmap(Hotel.Floors[0].Areas.Length * 60 + 1, Hotel.Floors.Length * 55 + 1);
            _Wireframe        = new Bitmap(Hotel.Floors[0].Areas.Length * 60 + 1, Hotel.Floors.Length * 55 + 1);

            DrawBackground();

            HotelEventManager.Start();
            HotelEventManager.HTE_Factor = (float)Hotel.Settings.HTEFactor;

            TimerHTE.Interval = (int)(1000 / Hotel.Settings.HTEFactor);
            TimerHTE.Start();

            DrawForeground();

            BackgroundLayer.Size = _BackgroundBuffer.Size;
            Size = new Size(BackgroundLayer.Size.Width + BackgroundLayer.Location.X * 3, BackgroundLayer.Size.Height + BackgroundLayer.Location.Y * 3);
        }
Exemplo n.º 2
0
 /// <summary>
 /// Pauses the Simulation and the HotelEventManager
 /// </summary>
 /// <param name="IsClosing"></param>
 public void PauseSimulation(bool IsClosing)
 {
     HotelEvents.HotelEventManager.Pauze();
     if (Paused)
     {
         TimerHTE.Start();
         if (!IsClosing)
         {
             ReceptionScreen.Close();
         }
         Paused = false;
     }
     else
     {
         TimerHTE.Stop();
         ReceptionScreen = new ReceptionScreen(this);
         Paused          = true;
     }
 }