public void RoomEventFinder(HotelNode GoToNode, HotelEvent evt) { if (evt.EventType.Equals(HotelEventType.CHECK_OUT) || evt.EventType.Equals(HotelEventType.EVACUATE)) // Checks if this events has to leave the hotel and make the rooms not full. { hotelRoom.Occupied = false; leaveHotel = true; MyRoom.hotelNode.BackgroundImage = Image.FromFile(@"..\..\Resources\Images\Room.png"); } hotelRoomDestination = (IHotelRoom)GoToNode.HotelObject; specificRoomDirections = RoomPathFinder.PathToRoom(hotelNode, GoToNode, hotelNodes); // Uses Dijkstra to find the shortest path to a room. (Location of Human, location of destination, hotel graph) }
public Cleaner(HotelNode hotelNode, Dictionary <string, string> Data, List <HotelNode> hotelNodes) { if (hotelNode != null && hotelNodes != null) { Sprite = Image.FromFile(@"..\..\Resources\Images\Cleaner.png"); this.hotelNode = hotelNode; this.hotelNodes = hotelNodes; this.hotelNode.Image = Sprite; leaveHotel = false; hotelNodeDestination = FindSpecificOpenRoom(Data, hotelNodes); MyRoom = (Room)hotelNodeDestination.HotelObject; specificRoomDirections = RoomPathFinder.PathToRoom(hotelNode, hotelNodeDestination, hotelNodes); // Uses Dijkstra to find the shortest path to a room. (Location of guest, location of destination, hotel graph) hotelRoom = (IHotelRoom)hotelNode.HotelObject; // Casts this hotelNodes object as a IHotelRoom. hotelRoom.AddHuman(this); // Add this instance of a cleaner to a concrete room type. } }