-
Notifications
You must be signed in to change notification settings - Fork 1
Arena
LielVaknin edited this page Dec 19, 2020
·
11 revisions
This class includes in the gameClient package.
It represents the arena of the game and manages the logic of the game in it.
- static final double EPS1 = 0.001, EPS2 = EPS1 * EPS1, EPS = EPS2
- final dw_graph_algorithms graphAlgo
- List<CL_Agent> agents - Represents the list of agents in the game.
- List<CL_Pokemon> pokemons - Represents the list of pokemons in the game.
- final game_service game - Represents the game from the server.
- final int level - Represents a level in the game.
- final int numAgents - Represents the number of agents at this specific level of the game.
-
Constructor - public Arena(int level)
gets a level, builds a new game using the game server, jsonToObject class's methods and places the agents in their first position before the game begins using startPositionOfAgents() method in this class. - public int getLevel() - Returns the the current level of the game.
- public void setAgents(List<CL_Agent> a) - Allows setting the list of agents.
- public dw_graph_algorithms getGraphAlgo() - Returns the graph of current level of the game.
- public game_service gatGame() - Returns the game in specific level.
- public List<CL_Agent> getAgents() - Returns a List of agents.
- public List<CL_Pokemon> getPokemons() - Returns a List of pokemons.
- public void startPositionOfAgents() - This method places the agents before the game begins. //* public void movementStrategy() - This method implements an algorithm which chooses for each agent with dest == -1 (agent who has no destination //at a given moment) his next destination during the game depending the new pokemons list.