Skip to content

Commit

Permalink
fix: initialize all the Prolog Rules when starting the game
Browse files Browse the repository at this point in the history
  • Loading branch information
mirko-felice committed Mar 7, 2023
1 parent 67a30aa commit f0d876e
Showing 1 changed file with 4 additions and 1 deletion.
Expand Up @@ -57,7 +57,10 @@ class ChessGame(private val vertx: Vertx) extends ChessPort:
override def startGame(gameConfiguration: GameConfiguration): Future[Unit] =
runOnVerticle("Game initialization") {
onlyIfNotConfigured {
this.state = Running(ChessGameStatus(gameConfiguration = gameConfiguration))
val status = ChessGameStatus(gameConfiguration = gameConfiguration)
this.state = Running(status)
// Initialize all the Prolog Rule(s)
assert(!ChessGameAnalyzer.check(status))
this.timerManager.start(
gameConfiguration.timeConstraint,
this.publishTimePassedEvent(),
Expand Down

0 comments on commit f0d876e

Please sign in to comment.