public TerrainType SenseSquare(Direction direction) { TerrainType terrain = WrappedRover.SenseSquare(direction); var updatedCoords = Position + direction; if (!updatedCoords.IsNegative) { TerrainUpdateProgress.Report(new TerrainUpdate(new Position(updatedCoords), terrain)); } StatsUpdateProgress.Report(StatsUpdate); return(terrain); }
public (Boolean isSuccess, TerrainType newTerrain) CollectSample() { (Boolean isSuccess, TerrainType newTerrain) = WrappedRover.CollectSample(); CancellationToken.ThrowIfCancellationRequested(); if (isSuccess) { TerrainUpdateProgress.Report(new TerrainUpdate(Position, newTerrain)); } StatsUpdateProgress.Report(StatsUpdate); return(isSuccess, newTerrain); }