/// <summary> /// Constructor /// </summary> /// <param name="humanParam"></param> public Cleaner(MovableParam humanParam) : base(humanParam) { // defining properties Path = new List <Node>(); Image = Image.FromFile("../../Resources/cleaner.png"); StatusCleaner = StatusCleaner.NOT_WORKING; StatusHuman = StatusHuman.WAITING; Location.SetLocationType(humanParam.StartLocation); Xpos = Location.LocationType.Position.X * Location.LocationType.oneDimensionSize.Width; Ypos = Location.LocationType.Position.Y * Location.LocationType.oneDimensionSize.Height; }
/// <summary> /// interacting with locationType /// </summary> /// <param name="drawUpdateTime"></param> public void InteractWithDestination(double drawUpdateTime) { // When cleaner has interacted(meaning : joined the facility) if (StatusHuman == StatusHuman.INTERACTING) { // If cleaner status is working (status is set when cleaner with shortest path is found) if (StatusCleaner == StatusCleaner.WORKING) { // if this facility has to be cleaned if (this.Location.LocationType.NoNeedToBeCleaned == false) { // with this speed this locationtype is going to be cleaned if (this.Location.LocationType.CleanFacility(drawUpdateTime) == true) { // Is areatype has been cleaned, we are not working anymore StatusCleaner = StatusCleaner.NOT_WORKING; // So we leave the Areatype this.Location.LocationType.LeaveFacility(this); SetWalkingStatus(); } } } } }