Change misleading label

Boards
Mathieu GROUSSEAU 1 month ago
parent 98e4ad2232
commit a960f6f390

@ -61,10 +61,10 @@ public struct Board {
// insertion coordinate computation is intentionally separated from actual insertion because the user may want to
// display a where the piece would end-up before doing the actual insertion
public func getInsertionCoordinates(direction: Direction, offset: Int) -> Coords {
public func getInsertionCoordinates(from: Direction, offset: Int) -> Coords {
precondition(offset >= 0, "Offset out of bounds")
switch direction {
switch from {
case .Top:
precondition(offset < self.columns, "Offset (column) out of bounds")
return Coords(offset, 0)

@ -79,7 +79,7 @@ final class EmptyBoardTests: XCTestCase {
}
private func _testInsertSide(side: Direction, offset: Int, expectedCoords: Coords) throws {
let result = board.getInsertionCoordinates(direction: side, offset: offset)
let result = board.getInsertionCoordinates(from: side, offset: offset)
// Note: Not sure I want Coordinates to be a simple tuple or a struct, as both have advantages that the other dont:
// Tuples can be initialized like so (col, row) which I find quite handy

Loading…
Cancel
Save