Skip to content
neta-r edited this page Dec 19, 2020 · 5 revisions

Arena

This class implements the arena of the game where the specific graph is saved, and the current pokemons and agents status is being saved and worked on, it represents a multi agents arena which moves on a graph and tries to catch the pokemons.

Data Structor & Fields:

  • directed weighted graph which represents the graph which is used in the arena.
  • agents a list of agents which represents the agents in the game.
  • pokemons a list of pokemons which represents the current pokemons in the game.
  • info a list of Strings which contains information about each agents , and the time left for the game.
  • time which represents the time left for the game.

Functions:

  • normal constructor which initilizes the info and time , pokemons,agents and graph are being added later in the game.
  • updateAgents which reads agents from a Jsonfile and creates,or updates all the agents in the game and returns a list of agents which represents the game's agents current status.
  • json2Pokemons function which reads the status and number of pokemons from the server in the format of Json and turns it into actual objects of pokemons , the function returns a list of pokemons which represents the current status of all the current pokemons in the game , the function only reads the pokemon and does not actually put it in the graph.
  • update edge a function which is used after json2Pokemon which updates each pokemon's edge based on their geolocation in the game and puts each pokemon on the graph.
  • w2f fuction to turn the graph's "world" (by Geolocation and such) to actual visualisation that can be read in the GUI.
  • Getters and setters of agents , pokemons , info , time.

Menu

Clone this wiki locally