Gamelib/src/main/java/uulm/teamname/marvelous/gamelibrary/messages/GameStructureMessage.java

44 lines
1.6 KiB
Java
Raw Normal View History

2021-06-03 14:12:21 +00:00
package uulm.teamname.marvelous.gamelibrary.messages;
import com.fasterxml.jackson.annotation.JsonIgnore;
import uulm.teamname.marvelous.gamelibrary.config.CharacterConfig;
import uulm.teamname.marvelous.gamelibrary.config.CharacterProperties;
import uulm.teamname.marvelous.gamelibrary.config.PartyConfig;
import uulm.teamname.marvelous.gamelibrary.config.ScenarioConfig;
import java.lang.reflect.Array;
import java.util.Arrays;
import java.util.stream.Stream;
public class GameStructureMessage extends BasicMessage {
// TODO: ADD ENUM FOR THIS
public String assignment;
2021-06-03 14:12:21 +00:00
/** The name of the first player */
public String playerOneName;
2021-06-03 14:12:21 +00:00
/** The name of the second player */
public String playerTwoName;
2021-06-03 14:12:21 +00:00
/** The characters that the first player has chosen (and is therefore playing with in this match) */
public CharacterProperties[] playerOneCharacters;
2021-06-03 14:12:21 +00:00
/** The characters that the second player has chosen (and is therefore playing with in this match) */
public CharacterProperties[] playerTwoCharacters;
2021-06-03 14:12:21 +00:00
/** The {@link PartyConfig Party Configuration} of the current match */
public PartyConfig matchconfig;
2021-06-03 14:12:21 +00:00
/** The {@link ScenarioConfig Scenario Configuration} of the current scenario */
public ScenarioConfig scenarioconfig;
2021-06-03 14:12:21 +00:00
@JsonIgnore public CharacterConfig getCharacterConfig() {
CharacterConfig characterConfig = new CharacterConfig();
characterConfig.characters = Stream
.concat(Arrays.stream(playerOneCharacters), Arrays.stream(playerTwoCharacters))
.toArray(CharacterProperties[]::new);
return characterConfig;
}
}