/// <summary> /// Goes to a room which needs cleaning /// </summary> private void _GoToRoom() { if (Path.Any()) { _Move(); } else if (ToCleanList.Any()) { _hteCalculateCounter = 0; FinalDes = ToCleanList.First().ToClean; _hteTime = ToCleanList.First().Time; SetPath(ToCleanList.First().ToClean); } if (Area == FinalDes) { Status = MovableStatus.CLEANING; } }
/// <summary> /// Start cleaning a room /// </summary> private void _Cleaning() { if (_hteCalculateCounter == _hteTime) { if (ToCleanList.Any()) { Status = MovableStatus.IDLE; ToCleanList.First().ToClean.AreaStatus = AreaStatus.EMPTY; ToCleanList.Dequeue(); } else { Status = MovableStatus.IDLE; } } else { _hteCalculateCounter++; } }