feat: add proper game initialization

This commit is contained in:
2021-05-31 21:37:18 +02:00
parent 184c839c3a
commit 4b794e99e9
5 changed files with 96 additions and 7 deletions

View File

@ -1,6 +1,5 @@
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;
@ -8,6 +7,7 @@ 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.ArrayList;
import java.util.Observer;
/** Represents a game instance. */
@ -60,9 +60,12 @@ public class GameInstance {
}
/**
* Initializes and starts the game.
* Initializes and starts the game. Selected characters are given as a list of indices from the {@link CharacterConfig#characters} array.
* @param selectedCharacters1 The characters selected by player 1
* @param selectedCharacters2 The characters selected by player 2
*/
public void startGame() {
public void startGame(ArrayList<Integer> selectedCharacters1, ArrayList<Integer> selectedCharacters2) {
emit(manager.initGame(selectedCharacters1, selectedCharacters2));
emit(manager.startGame());
}