Exemplo n.º 1
0
 public EnemyTracker(GameProps gameProps, int[,] map, IConsole console, HeadPositionReducer headPositionReducer)
 {
     _gameProps           = gameProps;
     _console             = console;
     _headPositionReducer = headPositionReducer;
     map.CloneMap();
     _binaryMap    = BinaryTrack.FromCartesian(gameProps, map);
     _currentTrack = BinaryTrack.StartEmptyTrack(gameProps);
 }
Exemplo n.º 2
0
 private void OnSurface(SurfaceDetected surfaceDetected)
 {
     _console.Debug("Opponent surface detected. Resetting enemy's track keeping the head");
     _currentTrack = BinaryTrack.StartEmptyTrack(_gameProps);
     if (_exactEnemyTrack != null)
     {
         _exactEnemyTrack = BinaryTrack.FromAllZeroExcept(_gameProps,
                                                          new List <(int, int)> {
             _exactEnemyTrack.Head.Value
         }, _exactEnemyTrack.Head);
Exemplo n.º 3
0
        public void OnSilence()
        {
            _console.Debug("Opponent silence detected. Resetting enemy's starting position");

            _currentTrack    = BinaryTrack.StartEmptyTrack(_gameProps);
            _exactEnemyTrack = null;
            _headPositionReducer.Handle(new SilenceDetected {
                LastMoveDirection = _lastMoveMoveDirection
            });
        }