Exemplo n.º 1
0
        public Int32 CollectPower()
        {
            Int32 power = WrappedRover.CollectPower();

            StatsUpdateProgress.Report(StatsUpdate);
            return(power);
        }
Exemplo n.º 2
0
        public TerrainType SenseSquare(Direction direction)
        {
            TerrainType terrain = WrappedRover.SenseSquare(direction);

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

            StatsUpdateProgress.Report(StatsUpdate);
            return(transmitted);
        }
Exemplo n.º 4
0
        public Int32 ProcessSamples()
        {
            Int32 samples = WrappedRover.ProcessSamples();

            StatsUpdateProgress.Report(StatsUpdate);
            return(samples);
        }
Exemplo n.º 5
0
        public Boolean Move(Direction direction)
        {
            Boolean success = WrappedRover.Move(direction);

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

            _actions.Add(new RoverAction(Instruction.Transmit));
            return(transmitCount);
        }
Exemplo n.º 7
0
        public Int32 ProcessSamples()
        {
            Int32 processCount = WrappedRover.ProcessSamples();

            _actions.Add(new RoverAction(Instruction.ProcessSamples));
            return(processCount);
        }
Exemplo n.º 8
0
        public Int32 CollectPower()
        {
            Int32 powerAmount = WrappedRover.CollectPower();

            _actions.Add(new RoverAction(Instruction.CollectPower));
            return(powerAmount);
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 12
0
 public (Boolean isSuccess, TerrainType newTerrain) CollectSample()
 {
     (Boolean isSuccess, TerrainType newTerrain) = WrappedRover.CollectSample();
     _actions.Add(new RoverAction(Instruction.CollectSample));
     return(isSuccess, newTerrain);
 }