feat: add support for the GamestateEvent in applyEvent

This commit is contained in:
2021-06-03 02:51:44 +02:00
parent c990356da0
commit 1601a2560d
4 changed files with 39 additions and 5 deletions

View File

@ -7,6 +7,7 @@ import uulm.teamname.marvelous.gamelibrary.IntVector2;
import uulm.teamname.marvelous.gamelibrary.config.*;
import uulm.teamname.marvelous.gamelibrary.entities.*;
import uulm.teamname.marvelous.gamelibrary.entities.Character;
import uulm.teamname.marvelous.gamelibrary.events.Event;
import uulm.teamname.marvelous.gamelibrary.requests.*;
import java.util.*;
@ -167,6 +168,16 @@ class GameLogicTest {
}
@Test
void testGamestateEvent() {
GameInstance a = new GameInstance(partyConfig, characterConfig, scenarioConfig);
GameInstance b = new GameInstance(partyConfig, characterConfig, scenarioConfig);
b.applyEvents(a.startGame(player1Selection, player2Selection));
assertEquals(a.toString(), b.toString(), "Second GameInstance copies the state successfully");
}
@Test
void testRasterize() {
ArrayList<IntVector2> result = GameLogic.rasterize(new IntVector2(0, 0), new IntVector2(1, 1), false, false);