示例#1
0
        public void LoadObjects()
        {
            lobbyNode = hotelGraph.HotelNodeSet.FirstOrDefault(n => n.RoomData.AreaType.Equals("Lobby"));    // Keeps the hotelNode where the lobby is on.
            HotelRoomFactory hotelRoomFactory = new HotelRoomFactory();

            foreach (HotelNode hotelNode in hotelGraph.HotelNodeSet)
            {
                Controls.Add(hotelNode);
                hotelNode.HotelObject = hotelRoomFactory.HotelRooms(hotelNode);
            }
            eventManager = new HotelEventManager();
            listener     = new HotelEventObserver(this);
            eventManager.StartEvents();                                                                      // Starts the hotel events.
            eventManager.RegisterListener(listener);                                                         // Registers the listener to the event manager.
            hotelTickrate.Start();
        }
 public void DeregisterListener(HotelEventObserver listener)
 {
     HotelEvents.HotelEventManager.Deregister(listener);
 }