Skip to content

Commit

Permalink
refactor(sdk): extract sensible moves limit
Browse files Browse the repository at this point in the history
  • Loading branch information
xeruf committed Jul 17, 2024
1 parent cc84bd8 commit 35610f3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion sdk/src/main/server-api/sc/api/plugins/TwoPlayerGameState.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ package sc.api.plugins

import com.thoughtworks.xstream.annotations.XStreamAsAttribute

const val SENSIBLE_MOVES_COUNT = 64

abstract class TwoPlayerGameState<M: IMove>(
@XStreamAsAttribute
override val startTeam: Team
Expand Down Expand Up @@ -33,7 +35,7 @@ abstract class TwoPlayerGameState<M: IMove>(
* Bei manchen Spielen wird aufgrund der unüberschaubaren Zahl möglicher Züge
* nur ein Ausschnitt zurückgegeben.
* */
open fun getSensibleMoves(): List<M> = moves().take(64)
open fun getSensibleMoves(): List<M> = moves().take(SENSIBLE_MOVES_COUNT)

/**
* Gibt progressiv alle möglichen Züge in der aktuellen Spielsituation zurück.
Expand Down

0 comments on commit 35610f3

Please sign in to comment.