Skip to content

CL_Pokemon

LielVaknin edited this page Dec 19, 2020 · 17 revisions

This class includes in the gameClient package and implements the pokemon interface.
It represents a pokemon in the game.

Fields in this class:

  • static final double EPS1 = 0.001, EPS2 = EPS1 * EPS1, EPS = EPS2
  • int id
  • double value
  • int type - Represents if the pokemon is on rising / falling edge.
  • geo_location pos
  • edge_data edge - Represents the edge which the pokemon is on.

CL_Pokemon methods:

  • Constructor - public CL_Pokemon(double value, int type, geo_location pos, directed_weighted_graph g),
    also uses the updateEdge method for setting the edge on which the pokemon is on.
  • public edge_data getEdge() - Returns the edge which the pokemon is stands on.
  • public double getValue() - Returns the value of the pokemon.
  • public int getType() - Returns the type of the pokemon.
    if type == -1 the pokemon is on falling edge, if type == 1 the pokemon is on rising edge.
  • public geo_location getPos() - Returns geo location <x,y,z>, aka Point3D of the pokemon.
  • public static void updateEdge(CL_Pokemon pok, directed_weighted_graph g) - This method finds on which edge the given pokemon is on and sets this edge to be the pokemon's edge.
  • String toString() - Returns a String which represents the value and type of this pokemon. // comperator

pokemon

Clone this wiki locally