private static void CopyToShipSettings(IShipTarget settings, int[] shipSettingsData) { // Ignore shipSettingsData[0], as 0-length ships do not exist for (int i = 1; i < shipSettingsData.Length; i++) { settings[i] = shipSettingsData[i]; } }
public Game(IGridTally targetNumberOfShipFieldsPerRow, IGridTally targetNumberOfShipFieldsPerColumn, IShipTarget targetNumberOfShipsPerLength, IBimaruGrid grid) { TargetNumberOfShipFieldsPerRow = targetNumberOfShipFieldsPerRow; TargetNumberOfShipFieldsPerColumn = targetNumberOfShipFieldsPerColumn; TargetNumberOfShipsPerLength = targetNumberOfShipsPerLength; Grid = grid; if (targetNumberOfShipFieldsPerRow.Length != grid.NumberOfRows || targetNumberOfShipFieldsPerColumn.Length != grid.NumberOfColumns) { throw new ArgumentOutOfRangeException("The number of rows/columns does not agree between tallies and grid."); } }