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