Beispiel #1
0
        /// <summary>
        /// Assigns a Room to a Customer if their in the CustomerQueue. Checks if there's a room that fits with the Customer and assigns it to the Customer.
        /// </summary>
        public void GuestCheckIn()
        {
            if (CustomerQueue.Count > 0)
            {
                //Get's the HotelEvent from the Queue
                HotelEvent hotelEvent = CustomerQueue.Dequeue();
                //Creates a temporary List that saves the free rooms that fits the Customer's specifications
                List <Room> AvaiableRooms = new List <Room>();
                //Get's the classification that the Customer wants (saved into the HotelEvent.Data Dictionairy)
                int Classification = PullIntsFromString(hotelEvent.Data.Values.First());

                //The new Customer is created here
                Customer NewCustomer = (Customer)HumanFactory.CreateHuman(EHumanType.Customer);

                //While loop continues to check if there's a room free for the customer with the set Classification (or higher, but lower than 6)
                while (NewCustomer.AssignedRoom == null && Classification <= 5)
                {
                    for (int i = 0; i < GlobalStatistics.Rooms.Count; i++)
                    {
                        if (Classification == 0 && GlobalStatistics.Rooms[i].RoomOwner is null && GlobalStatistics.Rooms[i].IsDirty == false)
                        {
                            AvaiableRooms.Add(GlobalStatistics.Rooms[i]);
                        }
                        else if (GlobalStatistics.Rooms[i].Classification == Classification && GlobalStatistics.Rooms[i].RoomOwner is null && GlobalStatistics.Rooms[i].IsDirty == false)
                        {
                            AvaiableRooms.Add(GlobalStatistics.Rooms[i]);
                        }
                    }
Beispiel #2
0
 /// <summary>
 /// Creates a set amount of Cleaners and places them in the Hotel
 /// </summary>
 /// <param name="CleanerAmount">The amount of Cleaners that need to be placed into the Hotel</param>
 public void HireCleaners(int CleanerAmount)
 {
     for (int i = 0; i < CleanerAmount; i++)
     {
         HumanFactory.CreateHuman(EHumanType.Cleaner);
         GlobalStatistics.Cleaners[i].CleanerID = i;
         GlobalStatistics.Cleaners[i].PositionX = PositionX;
         GlobalStatistics.Cleaners[i].PositionY = PositionY;
     }
 }