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
|
2021-06-03 14:20:23 +00:00
|
|
|
public String assignment;
|
2021-06-03 14:12:21 +00:00
|
|
|
|
|
|
|
/** The name of the first player */
|
2021-06-03 14:20:23 +00:00
|
|
|
public String playerOneName;
|
2021-06-03 14:12:21 +00:00
|
|
|
|
|
|
|
/** The name of the second player */
|
2021-06-03 14:20:23 +00:00
|
|
|
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) */
|
2021-06-03 14:20:23 +00:00
|
|
|
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) */
|
2021-06-03 14:20:23 +00:00
|
|
|
public CharacterProperties[] playerTwoCharacters;
|
2021-06-03 14:12:21 +00:00
|
|
|
|
|
|
|
/** The {@link PartyConfig Party Configuration} of the current match */
|
2021-06-03 14:20:23 +00:00
|
|
|
public PartyConfig matchconfig;
|
2021-06-03 14:12:21 +00:00
|
|
|
|
|
|
|
/** The {@link ScenarioConfig Scenario Configuration} of the current scenario */
|
2021-06-03 14:20:23 +00:00
|
|
|
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;
|
|
|
|
}
|
|
|
|
}
|