private Ship CreateShip(string input, ICoordinateBoundary cb) { var coord = cb.CoordinateFromInput(input); var pos = ShipPosition.Horizontal(coord, ShipSize.Destroyer); return(new Ship(pos)); }
private IEnumerable <BattleCoordinate> CalculateCoordinatesWithinBoundary(ICoordinateBoundary boundary) { var coords = new List <BattleCoordinate>(); for (int c = 0; c < boundary.ColumnValues.Count(); c++) { for (int r = 0; r < boundary.RowValues.Count(); r++) { coords.Add(new BattleCoordinate(c, r, boundary.ColumnValues.Count(), boundary.RowValues.Count())); } } return(coords); }
public TestShotStrategy(ICoordinateBoundary boundary) { this.boundary = boundary; }
public string ToString(ICoordinateBoundary boundary) => boundary.CoordinateToString(this);
public FleetBuilder(ICoordinateBoundary boundary, IRandomProvider random) { this.coordinates = CalculateCoordinatesWithinBoundary(boundary); this.random = random; }
public RandomShotStrategy(ICoordinateBoundary boundary, IRandomProvider random) { this.boundary = boundary; this.random = random; }
public ConsoleReadShotStrategy(ICoordinateBoundary boundary) { this.boundary = boundary; }