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 @@ -4,6 +4,7 @@ import org.slf4j.LoggerFactory
4
4
import sc.api.plugins.exceptions.GameLogicException
5
5
import sc.plugin2021.*
6
6
import sc.shared.InvalidMoveException
7
+ import kotlin.properties.Delegates
7
8
8
9
object GameRuleLogic {
9
10
val logger = LoggerFactory .getLogger(GameLogicException ::class .java)
@@ -141,7 +142,18 @@ object GameRuleLogic {
141
142
142
143
/* * Returns a list of all possible SetMoves. */
143
144
@JvmStatic
144
- fun getPossibleMoves (): List <SetMove > {
145
- return emptyList()
145
+ fun getPossibleMoves (gameState : GameState ): Set <SetMove > {
146
+ if (gameState.round == 1 ) return getPossibleStartMoves(gameState)
147
+ val color = gameState.currentColor
148
+
149
+ return emptySet()
150
+ }
151
+
152
+ /* * Returns a list of possible SetMoves if it's the first round. */
153
+ @JvmStatic
154
+ fun getPossibleStartMoves (gameState : GameState ): Set <SetMove > {
155
+ val color = gameState.currentColor
156
+
157
+ return emptySet()
146
158
}
147
159
}
You can’t perform that action at this time.
0 commit comments