示例#1
0
 internal static void CleanRoom(FamilyRoom room)
 {
     string[] features = room.Features.Split(',');
     foreach (var item in features)
     {
         Console.WriteLine(item + " is clean");
     }
     room.IsClean = true;
 }
示例#2
0
        internal void CleanRoom(FamilyRoom familyRoom)
        {
            // we cant set directly isClean parameters therefore we use isClean function that change
            //the value of the parameter. the if check that the room clean.


            if (!familyRoom.isClean())
            {
                familyRoom.isClean();
            }

            Console.WriteLine($"{familyRoom.GetFeatures()} is clean now");
        }
示例#3
0
 public static void SetRooms()
 {
     for (int i = 0; i < numberOfRooms; i++)
     {
         if (i < 33)
         {
             rooms[i] = new RoomForTwo(i, 50);
         }
         else if (i < 66)
         {
             rooms[i] = new FamilyRoom(i, 50);
         }
         else
         {
             rooms[i] = new Suite(i, 50);
         }
     }
 }
示例#4
0
 static Reception()
 {
     rooms = new Room[NUMBER_OF_ROOMS];
     for (int i = 0; i < NUMBER_OF_ROOMS - 1; i++)
     {
         if (i % 3 == 0)
         {
             rooms[i] = new RoomForTwo(i, 100);
         }
         else if (i % 2 == 0)
         {
             rooms[i] = new FamilyRoom(i, 100);
         }
         else
         {
             rooms[i] = new Suite(i, 100);
         }
     }
 }
示例#5
0
        public static Room CheckIn(Guest guest)
        {
            Random gen = new Random();

            //frist tine we check in we need to create rooms element
            if (rooms[0] == null)
            {
                for (int i = 0; i < rooms.Length; i++)
                {
                    Room room = null;
                    int  type = gen.Next(0, 3);


                    switch (type)
                    {
                    case 0:
                        room = new Suite(i, null, true);
                        break;

                    case 1:
                        room = new FamilyRoom(i, null, true);
                        break;

                    case 2:
                        room = new RoomForTwo(i, null, true);
                        break;
                    }

                    rooms[i] = room;
                }
            }
            int room_num;

            do
            {
                room_num = gen.Next(0, NUMBER_OF_ROOM);
            }while (rooms[room_num].GetGuest() != null);

            rooms[room_num].SetGuest(guest);

            numberOfGuests++;
            return(rooms[room_num]);
        }
示例#6
0
 private static void SendRoomService(FamilyRoom room)
 {
     roomService.CleanRoom(room);
 }
 internal void CleanRoom(FamilyRoom familyRoom)
 {
     familyRoom.SetIsClean(true);
     Console.WriteLine($"{familyRoom.GetFeatures()} have been cleaned");
 }
示例#8
0
 internal void CleanRoom(FamilyRoom familyRoom)
 {
     familyRoom.SetClean(true);
     Console.WriteLine(familyRoom.GetFeatures() + " were cleaned");
 }
示例#9
0
 internal void CleanRoom(FamilyRoom room)
 {
     room.SetIsClean = true;
     Console.WriteLine($"{room.GetFeatures()} was cleaned!!");
 }