Commit b7d24ba3 authored by morkolai's avatar morkolai
Browse files

WIP: started work on functionality for retrieving all possible moves

parent 3417e1a5
......@@ -2,6 +2,7 @@
package com.mygdx.game.model
import java.lang.Exception
import kotlin.system.measureTimeMillis
class Field {
......@@ -24,6 +25,13 @@ class Field {
return this.piece
}
fun hasPiece(): Boolean {
if (this.piece == null) {
return false
}
return true
}
fun removePiece() {
this.piece = null
}
......
package com.mygdx.game.model//Holds a ruleset and a board
package com.mygdx.game.model
import com.badlogic.gdx.math.Vector3
//Holds a ruleset and a board
class GameMode(rules:AbstractRules? = null, board:AbstractBoard? = null) {
......@@ -25,4 +29,35 @@ class GameMode(rules:AbstractRules? = null, board:AbstractBoard? = null) {
fun getRules(): AbstractRules? {
return this.rules
}
}
\ No newline at end of file
fun possibleMoves(position: Vector3): ArrayList<Vector3> {
var frontier: ArrayList<Vector3> = arrayListOf()
if (this.board?.fields?.get(position)?.hasPiece() == true) {
// algoritme
return frontier
}
return frontier
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment