private void PopulateFleet(Fleet fleet, ShipFactory shipFactory) { // fill the battlefield with an appropriate number of ships on each side. for (int i = 0; i < shipCount; i++) { field.AddShip(fleet, shipFactory.CreateRandomShip()); } }
public BattleSimulator(ShipFactory redSide, ShipFactory blueSide, int shipCount) { this.shipCount = shipCount; // build a bunch of ships and put them into play. PopulateFleet(Fleet.Red, redSide); PopulateFleet(Fleet.Blue, blueSide); }