File tree Expand file tree Collapse file tree 2 files changed +15
-3
lines changed
player/src/sc/player2021/logic
plugin/src/shared/sc/plugin2021/util Expand file tree Collapse file tree 2 files changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ class Logic(private val client: SimpleClient): IGameHandler{
35
35
override fun onRequestAction () {
36
36
val startTime = System .currentTimeMillis()
37
37
logger.info(" Es wurde ein Zug angefordert." )
38
- val possibleMoves = GameRuleLogic .getPossibleMoves()
38
+ val possibleMoves = GameRuleLogic .getPossibleMoves(gameState )
39
39
sendAction(
40
40
if (possibleMoves.isEmpty()) PassMove (gameState.currentColor)
41
41
else possibleMoves.random())
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ package sc.plugin2021.util
3
3
import org.slf4j.LoggerFactory
4
4
import sc.plugin2021.*
5
5
import sc.shared.InvalidMoveException
6
+ import kotlin.properties.Delegates
6
7
7
8
object GameRuleLogic {
8
9
val logger = LoggerFactory .getLogger(GameRuleLogic ::class .java)
@@ -140,7 +141,18 @@ object GameRuleLogic {
140
141
141
142
/* * Returns a list of all possible SetMoves. */
142
143
@JvmStatic
143
- fun getPossibleMoves (): List <SetMove > {
144
- return emptyList()
144
+ fun getPossibleMoves (gameState : GameState ): Set <SetMove > {
145
+ if (gameState.round == 1 ) return getPossibleStartMoves(gameState)
146
+ val color = gameState.currentColor
147
+
148
+ return emptySet()
149
+ }
150
+
151
+ /* * Returns a list of possible SetMoves if it's the first round. */
152
+ @JvmStatic
153
+ fun getPossibleStartMoves (gameState : GameState ): Set <SetMove > {
154
+ val color = gameState.currentColor
155
+
156
+ return emptySet()
145
157
}
146
158
}
You can’t perform that action at this time.
0 commit comments