Exemple #1
0
        // Important note:
        // This list contains a fair amount of code duplication
        // this was the cause of simultaneously working on event implementation
        // we made this choice because of the limeted time we had to implement these
        // as cause the actions list has become to big and needs a good refactor
        // there is no time for this so it is an issue that needs to be rethought in the fututure

        /// <summary>
        /// Cecks if there is anything to clean
        /// </summary>
        private void _IsSomthingInQueue()
        {
            IArea toClean = Hotel.GetRoomToClean();

            if (toClean != null)
            {
                ToCleanList.Enqueue(new CleaningEvent()
                {
                    ToClean = toClean, Time = 2
                });
                Status = MovableStatus.GOING_TO_ROOM;
            }

            if (ToCleanList.Any())
            {
                Status = MovableStatus.GOING_TO_ROOM;
            }
        }