예제 #1
0
        public Int32 CollectPower()
        {
            Int32 power = WrappedRover.CollectPower();

            StatsUpdateProgress.Report(StatsUpdate);
            return(power);
        }
예제 #2
0
        public TerrainType SenseSquare(Direction direction)
        {
            TerrainType terrain = WrappedRover.SenseSquare(direction);

            _actions.Add(new RoverAction(Instruction.Sense, direction));
            return(terrain);
        }
예제 #3
0
        public Int32 Transmit()
        {
            Int32 transmitted = WrappedRover.Transmit();

            StatsUpdateProgress.Report(StatsUpdate);
            return(transmitted);
        }
예제 #4
0
        public Int32 ProcessSamples()
        {
            Int32 samples = WrappedRover.ProcessSamples();

            StatsUpdateProgress.Report(StatsUpdate);
            return(samples);
        }
예제 #5
0
        public Boolean Move(Direction direction)
        {
            Boolean success = WrappedRover.Move(direction);

            _actions.Add(new RoverAction(Instruction.Move, direction));
            return(success);
        }
예제 #6
0
        public Int32 Transmit()
        {
            Int32 transmitCount = WrappedRover.Transmit();

            _actions.Add(new RoverAction(Instruction.Transmit));
            return(transmitCount);
        }
예제 #7
0
        public Int32 ProcessSamples()
        {
            Int32 processCount = WrappedRover.ProcessSamples();

            _actions.Add(new RoverAction(Instruction.ProcessSamples));
            return(processCount);
        }
예제 #8
0
        public Int32 CollectPower()
        {
            Int32 powerAmount = WrappedRover.CollectPower();

            _actions.Add(new RoverAction(Instruction.CollectPower));
            return(powerAmount);
        }
예제 #9
0
        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);
        }
예제 #10
0
        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);
        }
예제 #11
0
        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);
        }
예제 #12
0
 public (Boolean isSuccess, TerrainType newTerrain) CollectSample()
 {
     (Boolean isSuccess, TerrainType newTerrain) = WrappedRover.CollectSample();
     _actions.Add(new RoverAction(Instruction.CollectSample));
     return(isSuccess, newTerrain);
 }