public Int32 CollectPower() { Int32 power = WrappedRover.CollectPower(); StatsUpdateProgress.Report(StatsUpdate); return(power); }
public TerrainType SenseSquare(Direction direction) { TerrainType terrain = WrappedRover.SenseSquare(direction); _actions.Add(new RoverAction(Instruction.Sense, direction)); return(terrain); }
public Int32 Transmit() { Int32 transmitted = WrappedRover.Transmit(); StatsUpdateProgress.Report(StatsUpdate); return(transmitted); }
public Int32 ProcessSamples() { Int32 samples = WrappedRover.ProcessSamples(); StatsUpdateProgress.Report(StatsUpdate); return(samples); }
public Boolean Move(Direction direction) { Boolean success = WrappedRover.Move(direction); _actions.Add(new RoverAction(Instruction.Move, direction)); return(success); }
public Int32 Transmit() { Int32 transmitCount = WrappedRover.Transmit(); _actions.Add(new RoverAction(Instruction.Transmit)); return(transmitCount); }
public Int32 ProcessSamples() { Int32 processCount = WrappedRover.ProcessSamples(); _actions.Add(new RoverAction(Instruction.ProcessSamples)); return(processCount); }
public Int32 CollectPower() { Int32 powerAmount = WrappedRover.CollectPower(); _actions.Add(new RoverAction(Instruction.CollectPower)); return(powerAmount); }
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); }
public Boolean Move(Direction direction) { Position previous = Position; Boolean isSuccess = WrappedRover.Move(direction); CancellationToken.ThrowIfCancellationRequested(); if (isSuccess) { PositionUpdateProgress.Report(new PositionUpdate(previous, Position)); } StatsUpdateProgress.Report(StatsUpdate); Thread.Sleep(100); return(isSuccess); }
public (Boolean isSuccess, TerrainType newTerrain) CollectSample() { (Boolean isSuccess, TerrainType newTerrain) = WrappedRover.CollectSample(); _actions.Add(new RoverAction(Instruction.CollectSample)); return(isSuccess, newTerrain); }