fix: fixed building gamestate events (and the tests relating to that)

This commit is contained in:
Yannik Bretschneider 2021-05-11 03:20:19 +02:00
parent bbcff5d94b
commit 4203092f9a
2 changed files with 4 additions and 0 deletions

View File

@ -269,7 +269,9 @@ public class EventBuilder {
gameStateEvent.type = this.type; gameStateEvent.type = this.type;
gameStateEvent.entities = this.entities; gameStateEvent.entities = this.entities;
gameStateEvent.turnOrder = this.turnOrder; gameStateEvent.turnOrder = this.turnOrder;
gameStateEvent.mapSize = this.mapSize;
gameStateEvent.activeCharacter = this.activeCharacter; gameStateEvent.activeCharacter = this.activeCharacter;
gameStateEvent.stoneCooldowns = this.stoneCooldowns;
gameStateEvent.winCondition = this.winCondition; gameStateEvent.winCondition = this.winCondition;
return gameStateEvent; return gameStateEvent;
} }

View File

@ -259,7 +259,9 @@ class EventBuilderTest {
assertThat(new EventBuilder(EventType.GameStateEvent) // no exception if all properties present assertThat(new EventBuilder(EventType.GameStateEvent) // no exception if all properties present
.withEntities(entities) .withEntities(entities)
.withTurnOrder(turns) .withTurnOrder(turns)
.withMapSize(new IntVector2(42, 24))
.withActiveCharacter(turn) .withActiveCharacter(turn)
.withStoneCooldowns(new Integer[] {6, 5, 4, 3, 2, 1})
.withWinCondition(false) .withWinCondition(false)
.buildGameStateEvent() .buildGameStateEvent()
.check()).isTrue(); .check()).isTrue();