Skip to content

Commit

Permalink
feat(iblock): add y axis positions
Browse files Browse the repository at this point in the history
  • Loading branch information
Pablito2020 committed Apr 16, 2022
1 parent e774594 commit 9e4e259
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/kotlin/IBlock.kt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
class IBlock(position: Position) {
class IBlock(val position: Position) {

fun getNeededPositions(): List<Position> {
return listOf(Position(0,0), Position(0, 1), Position(0, 2), Position(0, 3))
return listOf(Position(0, this.position.y), Position(0, this.position.y + 1), Position(0, this.position.y + 2), Position(0, this.position.y + 3))
}

}
9 changes: 9 additions & 0 deletions src/test/kotlin/IBlockTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,13 @@ class IBlockTest {
)
}

@Test
fun `position 0,1 needed positions are (0,1), (0,2), (0,3), (0,4)`() {
val iBlock: IBlock = IBlock(Position(0, 1))
assertEquals(
listOf(Position(0, 1), Position(0, 2), Position(0, 3), Position(0, 4)),
iBlock.getNeededPositions()
)
}

}

0 comments on commit 9e4e259

Please sign in to comment.