예제 #1
0
        /// <summary>
        /// Creates a function hotel
        /// </summary>
        /// <param name="layout">A file which contains a functioning layout</param>
        /// <param name="settings">The Settings for the simulation</param>
        /// <param name="TypeOfBuilder">A type of builder that can handle the provided file</param>
        public Hotel(List <JsonModel> layout, SettingsModel settings, IHotelBuilder TypeOfBuilder)
        {
            // Hotel will handle the CheckIn_events so it can add them to its list
            // making it possible to keep the list private
            HotelEventManager.Register(this);

            _hotelBuilder = TypeOfBuilder;

            // Build the hotel
            HotelAreas    = _hotelBuilder.BuildHotel(layout, settings);
            HotelMovables = _hotelBuilder.BuildMovable(settings, this);

            // Set calculation properties
            HotelWidth  = HotelAreas.OrderBy(X => X.Position.X).Last().Position.X;
            HotelHeight = HotelAreas.OrderBy(Y => Y.Position.Y).Last().Position.Y;

            _elevatorCart = (ElevatorCart)HotelMovables.Find(X => X is ElevatorCart);

            // Methods for final initialization
            Dijkstra.IntilazeDijkstra(this);
            HotelEventManager.Start();
        }
 public Director(IHotelBuilder iHotelBuilder)
 {
     this._iHotelBuilder = iHotelBuilder;
 }