fix: add configs to GameInstance and fix GameState snapshots

This commit is contained in:
2021-05-31 18:07:43 +02:00
parent ab011e54da
commit 7c36ea5c5c
4 changed files with 31 additions and 9 deletions

View File

@ -3,6 +3,9 @@ package uulm.teamname.marvelous.gamelibrary.gamelogic;
import uulm.teamname.marvelous.gamelibrary.IntVector2;
import uulm.teamname.marvelous.gamelibrary.events.Event;
import uulm.teamname.marvelous.gamelibrary.events.EventType;
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.Request;
import java.util.Observer;
@ -22,8 +25,8 @@ public class GameInstance {
private final EventEmitter emitter = new EventEmitter();
/** Constructs a new {@link GameInstance}. */
public GameInstance(IntVector2 mapSize) {
_state = new GameState(mapSize);
public GameInstance(PartyConfig partyConfig, CharacterConfig characterConfig, ScenarioConfig scenarioConfig) {
_state = new GameState(partyConfig, characterConfig, scenarioConfig);
this.state = new GameStateView(_state);
manager = new GameStateManager(_state);
}