Skip to main content

Classes

Position​

  • int get_x()
  • int get_y()
  • double distance_to(Position)

Attacker​

  • size_t get_hp()
  • size_t get_id()
  • size_t get_type()
  • Position get_position()

Defender​

  • size_t get_hp()
  • size_t get_id()
  • size_t get_type()
  • Position get_position()

State​

  • const std::vector<Attacker>& get_attackers()
  • const std::vector<Defender>& get_defenders()
  • size_t get_turn_no()
  • size_t get_coins_left()

Game​

  • void spawn_attacker(size_t type_id, Position pos): Spawns Attacker of type type_id at Position pos
  • bool already_spawned_at_position(Position pos): Given a Position pos, it will return whether some attacker was already spawned in that position in the current turn
  • void set_target(size_t attacker_id, size_t defender_id): Sets the target for Attacker with id=attacker_id as Defender with id=defender_id. If the defender_id is invalid, the simulator will handle that automatically and try to set the target which is at the nearest position to the Attacker
  • void set_target(const Attacker &attacker, const Defender &defender): Sets the target for Attacker(attacker) as Defender(defender). If the defender is invalid somehow, the simulator will handle that automatically and try to set the target which is at the nearest position to the Attacker
  • std::ostringstream &logr(): Given a Game object(called game), you can do game.logr()<<"Log This\n"; and it will be shown in the renderer logs when the game is being rendered
  • const std::unordered_map<size_t, size_t> &get_player_set_targets()
  • const std::vector<std::pair<size_t, Position>> &get_spawn_positions()
  • const std::set<Position> &get_already_spawned_positions() const

AttackerType (Python Specific)​

  • hp: int
  • range: int
  • attack_power: int
  • price: int
  • speed: int
  • is_aerial: int

DefenderType (Python Specific)​

  • hp: int
  • range: int
  • attack_power: int
  • price: int
  • is_aerial: int

Attributes (C++ and Java Specific)​

This class stores the attributes for Attacker and Defender . This will be used as the value type in Constants for storing attributes of Attacker and Defender types.

  • unsigned hp
  • unsigned range
  • unsigned attackPower
  • unsigned speed (to be ignored for Defender)
  • unsigned price
  • unsigned is_aerial

SpawnDetail (Java Specific)​

  • int getTypeId() : Returns the typeId of the spawn
  • Position getPos(): Returns the position of the spawn