fix: add configs to GameInstance and fix GameState snapshots
This commit is contained in:
@ -7,6 +7,9 @@ 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.events.EventBuilder;
|
||||
import uulm.teamname.marvelous.gamelibrary.json.config.CharacterConfig;
|
||||
import uulm.teamname.marvelous.gamelibrary.json.config.PartyConfig;
|
||||
import uulm.teamname.marvelous.gamelibrary.json.config.ScenarioConfig;
|
||||
import uulm.teamname.marvelous.gamelibrary.requests.*;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@ -20,7 +23,7 @@ class GameLogicTest {
|
||||
|
||||
@Test
|
||||
void executeRequest() {
|
||||
GameState state = new GameState(new IntVector2(10, 10));
|
||||
GameState state = new GameState(new PartyConfig(), new CharacterConfig(), new ScenarioConfig());
|
||||
//build a nice state (add entities and stuff)
|
||||
ArrayList<Event> result = GameLogic.executeRequest(state, new RequestBuilder(RequestType.MeleeAttackRequest)
|
||||
//build a nice request to check
|
||||
|
@ -6,6 +6,9 @@ import uulm.teamname.marvelous.gamelibrary.entities.EntityID;
|
||||
import uulm.teamname.marvelous.gamelibrary.entities.EntityType;
|
||||
import uulm.teamname.marvelous.gamelibrary.entities.Rock;
|
||||
import uulm.teamname.marvelous.gamelibrary.events.Event;
|
||||
import uulm.teamname.marvelous.gamelibrary.json.config.CharacterConfig;
|
||||
import uulm.teamname.marvelous.gamelibrary.json.config.PartyConfig;
|
||||
import uulm.teamname.marvelous.gamelibrary.json.config.ScenarioConfig;
|
||||
import uulm.teamname.marvelous.gamelibrary.requests.CharacterRequest;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@ -18,7 +21,7 @@ class GameStateTest {
|
||||
//TODO: test all properties in GameStateTest.testSnapshot
|
||||
|
||||
//base state
|
||||
GameState state = new GameState(new IntVector2(10, 10));
|
||||
GameState state = new GameState(new PartyConfig(), new CharacterConfig(), new ScenarioConfig());
|
||||
|
||||
//set up game
|
||||
state.entities.addEntity(new Rock(new EntityID(EntityType.Rocks, 0), new IntVector2(0, 0), 100));
|
||||
|
Reference in New Issue
Block a user