Skip to content
LielVaknin edited this page Dec 20, 2020 · 11 revisions

This class included in the gameClient package.
It represents the arena of the game and manages the logic of the game in it.

Fields in this class:

  • 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.

Arena methods:

  • Constructor - 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.
  • int getLevel() - Returns the current level of this game.
  • dw_graph_algorithms getGraphAlgo() - Returns the graph of current level of this game.
  • game_service gatGame() - Returns the game in specific level.
  • List<CL_Agent> getAgents() - Returns a List of agents of this game.
  • List<CL_Pokemon> getPokemons() - Returns a List of pokemons of this game.
  • void startPositionOfAgents() - This method places the agents before the game begins.
  • void firstChooseNext() - This method makes for each agent his first movement in this game.
  • 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.
Clone this wiki locally