2021-04-29 17:15:29 +00:00
|
|
|
package uulm.teamname.marvelous.gamelibrary.gamelogic;
|
|
|
|
|
|
|
|
import uulm.teamname.marvelous.gamelibrary.IntVector2;
|
|
|
|
import uulm.teamname.marvelous.gamelibrary.entities.Entity;
|
|
|
|
import uulm.teamname.marvelous.gamelibrary.entities.EntityID;
|
2021-04-30 18:54:34 +00:00
|
|
|
import uulm.teamname.marvelous.gamelibrary.entities.EntityList;
|
2021-04-29 17:15:29 +00:00
|
|
|
import uulm.teamname.marvelous.gamelibrary.entities.StoneType;
|
|
|
|
import uulm.teamname.marvelous.gamelibrary.Tuple;
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.HashMap;
|
|
|
|
|
2021-04-30 18:54:34 +00:00
|
|
|
/** Represents the state of a game instance. */
|
2021-04-29 17:15:29 +00:00
|
|
|
class GameState {
|
2021-04-30 18:54:34 +00:00
|
|
|
/** The size of the map */
|
2021-04-29 17:15:29 +00:00
|
|
|
public final IntVector2 mapSize;
|
|
|
|
|
2021-04-30 18:54:34 +00:00
|
|
|
/** The list of {@link Entity}s inside the game */
|
|
|
|
public final EntityList entities = new EntityList();
|
2021-04-29 17:15:29 +00:00
|
|
|
|
2021-04-30 18:54:34 +00:00
|
|
|
/** The total amount of full turn cycles that occurred */
|
2021-04-29 17:15:29 +00:00
|
|
|
public int roundNumber = 0;
|
|
|
|
|
2021-04-30 18:54:34 +00:00
|
|
|
/** The turn order of every character */
|
2021-04-29 17:15:29 +00:00
|
|
|
public ArrayList<EntityID> turnOrder;
|
|
|
|
|
2021-04-30 18:54:34 +00:00
|
|
|
/** The total amount of turns that occurred */
|
2021-04-29 17:15:29 +00:00
|
|
|
public int turnNumber = 0;
|
|
|
|
|
2021-04-30 18:54:34 +00:00
|
|
|
/** The {@link EntityID} of the active character */
|
2021-04-29 17:15:29 +00:00
|
|
|
public EntityID activeCharacter;
|
|
|
|
|
2021-04-30 18:54:34 +00:00
|
|
|
/** Whether or not the game was won */
|
2021-04-29 17:15:29 +00:00
|
|
|
public boolean won = false;
|
|
|
|
|
2021-04-30 18:54:34 +00:00
|
|
|
/** The global cooldown of every infinity stone */
|
|
|
|
public final HashMap<StoneType, Float> stoneCooldown = new HashMap<>();
|
2021-04-29 17:15:29 +00:00
|
|
|
|
2021-04-30 18:54:34 +00:00
|
|
|
/** The store of the {@link WinCondition} data for every win condition for each player */
|
|
|
|
public final HashMap<Tuple<ParticipantType, WinCondition>, Integer> winConditions = new HashMap<>();
|
2021-04-29 17:15:29 +00:00
|
|
|
|
2021-04-30 18:54:34 +00:00
|
|
|
/**
|
|
|
|
* Constructs a new {@link GameState}.
|
|
|
|
* @param mapSize The size of the map
|
2021-04-29 17:15:29 +00:00
|
|
|
*/
|
|
|
|
public GameState(IntVector2 mapSize) {
|
|
|
|
this.mapSize = mapSize;
|
|
|
|
}
|
|
|
|
|
2021-04-30 18:54:34 +00:00
|
|
|
/**
|
|
|
|
* Clones the state into a new {@link GameState} object.
|
|
|
|
* @return The cloned game state
|
2021-04-29 17:15:29 +00:00
|
|
|
*/
|
|
|
|
public GameState snapshot() {
|
|
|
|
//TODO: implement GameState.snapshot
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
}
|