/// <summary> /// Gets the target position of the ship at the provided <paramref name="index"/> /// </summary> /// <param name="index">The index of the ship in the fleet</param> /// <returns>The target position of the ship</returns> public static Vector3 GetShipTargetPosition(int index) { System.Tuple <int, int> rowAndPos = TriangleNumbers.GetRowAndPos(index); int row = rowAndPos.Item1; int posInRow = rowAndPos.Item2; //Debug.Log($"Ship #{index} is in row {row} at position {posInRow}"); return(GetShipTargetPosition(row, posInRow)); }
GameObject CreateShip(int index) => CreateShip(TriangleNumbers.GetRowAndPos(index + 1));