Exemplo n.º 1
0
 public ShipController(
     IAttacker attacker,
     IBoardCreator boardCreator,
     IShipCreator shipCreator,
     IShipPlacer shipPlacer)
 {
     _shipCreator = shipCreator;
     _shipPlacer  = shipPlacer;
 }
Exemplo n.º 2
0
        public RobotPlayer(IBoardDrawer boardDrawer,
                           IBattleField battleField,
                           IShipPlacer shipPlacer)
        {
            _battleField = battleField;
            _shipPlacer  = shipPlacer;
            _boardDrawer = boardDrawer;

            _exploratoryAttack = new ExploratoryAttack(battleField, shipPlacer);
            _afterHitAttack    = new AfterHitAttack(battleField);

            _currentAttackMode = AttackMode.Exploratory;
        }
Exemplo n.º 3
0
 public ExploratoryAttack(IBattleField battleField, IShipPlacer shipPlacer)
 {
     _battleField = battleField ?? throw new ArgumentNullException(nameof(battleField));
     _shipPlacer  = shipPlacer ?? throw new ArgumentNullException(nameof(shipPlacer));
 }
 public SeaBattleGame(IShipGenerator randomShipGenerator, IShipPlacer shipPlacer)
 {
     this.randomShipGenerator = randomShipGenerator;
     this.shipPlacer          = shipPlacer;
     ResetGrid();
 }
Exemplo n.º 5
0
 public HumanPlayer(IBoardDrawer boardDrawer, IBattleField battleField, IShipPlacer shipPlacer)
 {
     _boardDrawer = boardDrawer ?? throw new ArgumentNullException(nameof(boardDrawer));
     _battleField = battleField ?? throw new ArgumentNullException(nameof(battleField));
     _shipPlacer  = shipPlacer ?? throw new ArgumentNullException(nameof(shipPlacer));
 }