- Summary
- namespace bc
- Summary
- Members
- public static void
print_trace
()
- public static bool
clear_error
()
- public inline Planet
planet_other
(Planet planet)
- public inline std::string
to_string
(Planet planet)
- public inline int
direction_dx
(Direction direction)
- public inline int
direction_dy
(Direction direction)
- public inline bool
direction_is_diagonal
(Direction direction)
- public inline Direction
direction_opposite
(Direction direction)
- public inline Direction
direction_rotate_left
(Direction direction)
- public inline Direction
direction_rotate_right
(Direction direction)
- public inline bool
is_structure
(UnitType unit_type)
- public inline bool
is_robot
(UnitType unit_type)
- public static unsigned
unit_type_get_factory_cost
(UnitType unit_type)
- public static unsigned
unit_type_get_blueprint_cost
(UnitType unit_type)
- public static unsigned
unit_type_get_replicate_cost
()
- public inline unsigned
unit_type_get_value
(UnitType unit_type)
- public static void
- class bc::AsteroidPattern
- Summary
- Members
- public inline
AsteroidPattern
(bc_AsteroidPattern * pattern)
- public inline bool
has_asteroid_on_round
(unsigned round) const
- public inline
AsteroidStrike
get_asteroid_on_round
(unsigned round) const
- public inline std::unordered_map< unsigned,
AsteroidStrike
>
get_all_strikes
()
- public inline
- class bc::AsteroidStrike
- Summary
- Members
- public
AsteroidStrike
() = default
- public inline
AsteroidStrike
(unsigned karbonite,const
MapLocation
& location)
- public inline
AsteroidStrike
(bc_AsteroidStrike * asteroid)
- public inline unsigned
get_karbonite
() const
- public inline
MapLocation
get_map_location
() const
- public
- class bc::GameController
- Summary
- Members
- public inline
GameController
()
- public inline
~GameController
()
- public
GameController
(const
GameController
& that) = delete
- public
GameController
&
operator=
(const
GameController
& that) = delete
- public inline void
next_turn
() const
- public inline unsigned
get_round
() const
- public inline Planet
get_planet
() const
- public inline Team
get_team
() const
- public inline const
PlanetMap
&
get_starting_planet
(Planet planet)
- public inline const
PlanetMap
&
get_earth_map
() const
- public inline const
PlanetMap
&
get_mars_map
() const
- public inline unsigned
get_karbonite
() const
- public inline bool
has_unit
(unsigned id) const
- public inline
Unit
get_unit
(unsigned id) const
- public inline std::vector<
Unit
>
get_units
() const
- public inline std::vector<
Unit
>
get_my_units
() const
- public inline std::vector<
Unit
>
get_units_in_space
() const
- public inline unsigned
get_karbonite_at
(const
MapLocation
& map_location) const
- public inline std::vector<
MapLocation
>
get_all_locations_within
(const
MapLocation
& map_location,unsigned radius_squared) const
- public inline bool
can_sense_location
(const
MapLocation
& map_location) const
- public inline bool
can_sense_unit
(unsigned id) const
- public inline std::vector<
Unit
>
sense_nearby_units
(const
MapLocation
& map_location,unsigned radius_squared) const
- public inline std::vector<
Unit
>
sense_nearby_units_by_team
(const
MapLocation
& map_location,unsigned radius_squared,Team team) const
- public inline std::vector<
Unit
>
sense_nearby_units_by_type
(const
MapLocation
& map_location,unsigned radius_squared,UnitType type) const
- public inline bool
has_unit_at_location
(const
MapLocation
& map_location) const
- public inline
Unit
sense_unit_at_location
(const
MapLocation
& map_location) const
- public inline const
AsteroidPattern
&
get_asteroid_pattern
() const
- public inline const
OrbitPattern
&
get_orbit_pattern
() const
- public inline unsigned
get_current_duration_of_flight
() const
- public inline std::vector< int >
get_team_array
(Planet planet) const
- public inline void
write_team_array
(unsigned index,int value) const
- public inline void
disintegrate_unit
(unsigned id) const
- public inline bool
is_occupiable
(const
MapLocation
& map_location) const
- public inline bool
can_move
(unsigned id,Direction direction) const
- public inline bool
is_move_ready
(unsigned id) const
- public inline void
move_robot
(unsigned id,Direction direction) const
- public inline bool
can_attack
(unsigned id,unsigned target_id) const
- public inline bool
is_attack_ready
(unsigned id) const
- public inline void
attack
(unsigned id,unsigned target_id) const
- public inline
ResearchInfo
get_research_info
() const
- public inline bool
reset_research
() const
- public inline bool
queue_research
(UnitType branch) const
- public inline bool
can_harvest
(unsigned id,Direction direction) const
- public inline void
harvest
(unsigned id,Direction direction) const
- public inline bool
can_blueprint
(unsigned id,UnitType unit_type,Direction direction) const
- public inline void
blueprint
(unsigned id,UnitType unit_type,Direction direction) const
- public inline bool
can_build
(unsigned worker_id,unsigned blueprint_id) const
- public inline void
build
(unsigned worker_id,unsigned blueprint_id) const
- public inline bool
can_repair
(unsigned worker_id,unsigned structure_id) const
- public inline void
repair
(unsigned worker_id,unsigned structure_id) const
- public inline bool
can_replicate
(unsigned worker_id,Direction direction) const
- public inline void
replicate
(unsigned worker_id,Direction direction) const
- public inline bool
can_javelin
(unsigned knight_id,unsigned target_id) const
- public inline bool
is_javelin_ready
(unsigned knight_id) const
- public inline void
javelin
(unsigned knight_id,unsigned target_id) const
- public inline bool
can_begin_snipe
(unsigned ranger_id,const
MapLocation
& map_location) const
- public inline void
begin_snipe
(unsigned ranger_id,const
MapLocation
& map_location) const
- public inline bool
can_begin_blink
(unsigned mage_id,const
MapLocation
& map_location) const
- public inline bool
is_blink_ready
(unsigned mage_id) const
- public inline void
blink
(unsigned mage_id,const
MapLocation
& map_location) const
- public inline bool
can_heal
(unsigned healer_id,unsigned target_id) const
- public inline bool
is_heal_ready
(unsigned healer_id) const
- public inline void
heal
(unsigned healer_id,unsigned target_id) const
- public inline bool
is_overcharge_ready
(unsigned healer_id) const
- public inline void
overcharge
(unsigned healer_id,unsigned target_id) const
- public inline bool
can_load
(unsigned structure_id,unsigned robot_id) const
- public inline void
load
(unsigned structure_id,unsigned robot_id) const
- public inline bool
can_unload
(unsigned structure_id,Direction direction) const
- public inline void
unload
(unsigned structure_id,Direction direction) const
- public inline bool
can_produce_robot
(unsigned factory_id,UnitType unit_type) const
- public inline void
produce_robot
(unsigned factory_id,UnitType unit_type) const
- public inline
RocketLandingInfo
get_rocket_landings
() const
- public inline bool
can_launch_rocket
(unsigned rocket_id,const
MapLocation
& map_location) const
- public inline void
launch_rocket
(unsigned rocket_id,const
MapLocation
& map_location) const
- public inline unsigned
get_time_left_ms
() const
- public inline bool
is_over
() const
- public inline Team
get_winning_team
() const
- public inline
- class bc::Location
- Summary
- Members
- public inline
Location
()
- public inline
Location
(const
MapLocation
& map_location)
- public inline
Location
(unsigned garrison_id)
- public inline explicit
Location
(bc_Location * location)
- public inline bool
is_on_map
() const
- public inline bool
is_on_planet
(Planet planet) const
- public inline
MapLocation
get_map_location
() const
- public inline bool
is_in_garrison
() const
- public inline int
get_structure
() const
- public inline bool
is_in_space
() const
- public inline bool
is_adjacent_to
(
Location
location)
- public inline bool
is_within_range
(unsigned range,
Location
location)
- public inline
- class bc::MapLocation
- Summary
- Members
- public inline
MapLocation
()
- public inline
MapLocation
(Planet planet,int x,int y)
- public inline
MapLocation
(const
MapLocation
& map_location)
- public
MapLocation
(
MapLocation
&&) = default
- public inline
MapLocation
&
operator=
(const
MapLocation
& map_location)
- public
MapLocation
&
operator=
(
MapLocation
&&) = default
- public inline Planet
get_planet
() const
- public inline int
get_x
() const
- public inline int
get_y
() const
- public inline void
set_planet
(Planet planet)
- public inline void
set_x
(int x)
- public inline void
set_y
(int y)
- public inline
MapLocation
add
(Direction direction) const
- public inline
MapLocation
subtract
(Direction direction) const
- public inline
MapLocation
add_multiple
(Direction direction,int multiple) const
- public inline
MapLocation
translate
(int dx,int dy) const
- public inline unsigned
distance_squared_to
(const
MapLocation
& map_location) const
- public inline Direction
direction_to
(const
MapLocation
& map_location) const
- public inline bool
is_adjacent_to
(const
MapLocation
& map_location) const
- public inline bool
is_within_range
(unsigned range,const
MapLocation
& map_location) const
- public inline bool
operator==
(const
MapLocation
& map_location) const
- public inline bool
operator!=
(const
MapLocation
& map_location) const
- public inline
- class bc::OrbitPattern
- Summary
- Members
- public inline
OrbitPattern
(bc_OrbitPattern * orbit_pattern)
- public inline unsigned
get_amplitude
() const
- public inline unsigned
get_period
() const
- public inline unsigned
get_center
() const
- public inline unsigned
duration
(unsigned round) const
- public inline
- class bc::PlanetMap
- Summary
- Members
- public inline
PlanetMap
()
- public inline
PlanetMap
(bc_PlanetMap * planet_map)
- public inline
PlanetMap
(const
PlanetMap
& planet_map)
- public
PlanetMap
(
PlanetMap
&& planet_map) = default
- public inline
PlanetMap
&
operator=
(const
PlanetMap
& planet_map)
- public
PlanetMap
&
operator=
(
PlanetMap
&& planet_map) = default
- public inline Planet
get_planet
() const
- public inline unsigned
get_height
() const
- public inline unsigned
get_width
() const
- public inline const std::vector<
Unit
> &
get_initial_units
() const
- public inline bool
is_on_map
(const
MapLocation
& location) const
- public inline bool
is_passable_terrain_at
(const
MapLocation
& map_location) const
- public inline unsigned
get_initial_karbonite_at
(const
MapLocation
& map_location) const
- public inline std::vector< std::vector< std::pair< bool, unsigned > > >
get_initial_map
() const
- public inline
- class bc::ResearchInfo
- Summary
- Members
- public inline
ResearchInfo
(bc_ResearchInfo * info)
- public inline unsigned
max_level
(UnitType branch) const
- public inline unsigned
cost_of
(UnitType branch,unsigned level) const
- public inline unsigned
get_level
(UnitType branch) const
- public inline std::vector< UnitType >
get_queue
() const
- public inline bool
has_next_in_queue
() const
- public inline UnitType
next_in_queue
() const
- public inline unsigned
rounds_left
() const
- public inline
- class bc::RocketLanding
- Summary
- Members
- public inline
RocketLanding
(bc_RocketLanding * rocket_landing)
- public inline unsigned
get_rocket_id
() const
- public inline const
MapLocation
&
get_destination
() const
- public inline
- class bc::RocketLandingInfo
- Summary
- Members
- public inline explicit
RocketLandingInfo
(bc_RocketLandingInfo * rocket_landing_info)
- public inline std::vector<
RocketLanding
>
get_landings_on_round
(unsigned round)
- public inline explicit
- class bc::Unit
- Summary
- Members
- public inline
Unit
()
- public inline explicit
Unit
(bc_Unit * unit)
- public inline
Unit
(const
Unit
& unit)
- public
Unit
(
Unit
&& unit) = default
- public inline
Unit
&
operator=
(const
Unit
& unit)
- public
Unit
&
operator=
(
Unit
&& unit) = default
- public inline UnitType
get_unit_type
() const
- public inline Team
get_team
() const
- public inline
Location
get_location
() const
- public inline bool
is_on_map
() const
- public inline
MapLocation
get_map_location
() const
- public inline unsigned
get_id
() const
- public inline unsigned
get_health
() const
- public inline unsigned
get_max_health
() const
- public inline unsigned
get_vision_range
() const
- public inline int
get_damage
() const
- public inline unsigned
get_movement_heat
() const
- public inline unsigned
get_movement_cooldown
() const
- public inline unsigned
get_attack_heat
() const
- public inline unsigned
get_attack_cooldown
() const
- public inline unsigned
get_attack_range
() const
- public inline unsigned
get_ability_heat
() const
- public inline unsigned
get_ability_cooldown
() const
- public inline unsigned
get_ability_range
() const
- public inline bool
is_ability_unlocked
() const
- public inline bool
worker_has_acted
() const
- public inline unsigned
get_worker_build_health
() const
- public inline unsigned
get_worker_repair_health
() const
- public inline unsigned
get_worker_harvest_amount
() const
- public inline unsigned
get_knight_defense
() const
- public inline unsigned
get_ranger_cannot_attack_range
() const
- public inline unsigned
get_ranger_max_countdown
() const
- public inline unsigned
get_ranger_countdown
() const
- public inline bool
ranger_is_sniping
() const
- public inline
MapLocation
get_ranger_target_location
() const
- public inline unsigned
get_healer_self_heal_amount
() const
- public inline bool
structure_is_built
() const
- public inline unsigned
get_structure_max_capacity
() const
- public inline std::vector< unsigned >
get_structure_garrison
() const
- public inline bool
is_factory_producing
() const
- public inline UnitType
get_factory_unit_type
() const
- public inline unsigned
get_factory_rounds_left
() const
- public inline unsigned
get_factory_max_rounds_left
() const
- public inline bool
rocket_is_used
() const
- public inline int
get_rocket_blast_damage
() const
- public inline unsigned
get_rocket_travel_time_decrease
() const
- public inline bool
is_structure
() const
- public inline bool
is_robot
() const
- public inline
Created by gh-md-toc
Members | Descriptions |
---|---|
namespace bc |
Members | Descriptions |
---|---|
public static void print_trace () |
|
public static bool clear_error () |
|
public inline Planet planet_other (Planet planet) |
Get other planet. |
public inline std::string to_string (Planet planet) |
Create a human-readable representation of a Planet |
public inline int direction_dx (Direction direction) |
Returns the x displacement of this direction. |
public inline int direction_dy (Direction direction) |
Returns the y displacement of this direction. |
public inline bool direction_is_diagonal (Direction direction) |
Returns whether this direction is a diagonal one. |
public inline Direction direction_opposite (Direction direction) |
Returns the direction opposite this one, or Center if it's Center |
public inline Direction direction_rotate_left (Direction direction) |
Returns the direction 45 degrees to the left (counter-clockwise) of this one, or Center if it's Center. |
public inline Direction direction_rotate_right (Direction direction) |
Returns the direction 45 degrees to the right (clockwise) of this one, or Center if it's Center. |
public inline bool is_structure (UnitType unit_type) |
|
public inline bool is_robot (UnitType unit_type) |
|
public static unsigned unit_type_get_factory_cost (UnitType unit_type) |
|
public static unsigned unit_type_get_blueprint_cost (UnitType unit_type) |
|
public static unsigned unit_type_get_replicate_cost () |
|
public inline unsigned unit_type_get_value (UnitType unit_type) |
|
class bc::AsteroidPattern |
|
class bc::AsteroidStrike |
|
class bc::GameController |
|
class bc::Location |
|
class bc::MapLocation |
Two-dimensional coordinates in the Battlecode world. |
class bc::OrbitPattern |
|
class bc::PlanetMap |
|
class bc::ResearchInfo |
|
class bc::RocketLanding |
|
class bc::RocketLandingInfo |
|
class bc::Unit |
public static void
print_trace
()
public static bool
clear_error
()
public inline Planet
planet_other
(Planet planet)
Get other planet.
planet
the other planet
public inline std::string
to_string
(Planet planet)
Create a human-readable representation of a Planet
planet
the human-readable string
public inline int
direction_dx
(Direction direction)
Returns the x displacement of this direction.
direction
the x displacement
public inline int
direction_dy
(Direction direction)
Returns the y displacement of this direction.
direction
the y displacement
public inline bool
direction_is_diagonal
(Direction direction)
Returns whether this direction is a diagonal one.
direction
bool if the direction is diagonal or not
public inline Direction
direction_opposite
(Direction direction)
Returns the direction opposite this one, or Center if it's Center
direction
the opposite direction
public inline Direction
direction_rotate_left
(Direction direction)
Returns the direction 45 degrees to the left (counter-clockwise) of this one, or Center if it's Center.
direction
the direction 45 degrees to the left
public inline Direction
direction_rotate_right
(Direction direction)
Returns the direction 45 degrees to the right (clockwise) of this one, or Center if it's Center.
direction
the direction 45 degrees to the right
public inline bool
is_structure
(UnitType unit_type)
public inline bool
is_robot
(UnitType unit_type)
public static unsigned
unit_type_get_factory_cost
(UnitType unit_type)
public static unsigned
unit_type_get_blueprint_cost
(UnitType unit_type)
public static unsigned
unit_type_get_replicate_cost
()
public inline unsigned
unit_type_get_value
(UnitType unit_type)
Members | Descriptions |
---|---|
public inline AsteroidPattern (bc_AsteroidPattern * pattern) |
|
public inline bool has_asteroid_on_round (unsigned round) const |
|
public inline AsteroidStrike get_asteroid_on_round (unsigned round) const |
|
public inline std::unordered_map< unsigned, AsteroidStrike > get_all_strikes () |
Utility function for gathering all strikes info rather than consulting for each round (they don't change the whole game) |
public inline
AsteroidPattern
(bc_AsteroidPattern * pattern)
public inline bool
has_asteroid_on_round
(unsigned round) const
public inline
AsteroidStrike
get_asteroid_on_round
(unsigned round) const
public inline std::unordered_map< unsigned,
AsteroidStrike
>
get_all_strikes
()
Utility function for gathering all strikes info rather than consulting for each round (they don't change the whole game)
the map strikes for each round
Members | Descriptions |
---|---|
public AsteroidStrike () = default |
|
public inline AsteroidStrike (unsigned karbonite,const MapLocation & location) |
|
public inline AsteroidStrike (bc_AsteroidStrike * asteroid) |
|
public inline unsigned get_karbonite () const |
|
public inline MapLocation get_map_location () const |
public
AsteroidStrike
() = default
public inline
AsteroidStrike
(unsigned karbonite,const
MapLocation
& location)
public inline
AsteroidStrike
(bc_AsteroidStrike * asteroid)
public inline unsigned
get_karbonite
() const
public inline
MapLocation
get_map_location
() const
Members | Descriptions |
---|---|
public inline GameController () |
|
public inline ~GameController () |
|
public GameController (const GameController & that) = delete |
|
public GameController & operator= (const GameController & that) = delete |
|
public inline void next_turn () const |
|
public inline unsigned get_round () const |
|
public inline Planet get_planet () const |
|
public inline Team get_team () const |
|
public inline const PlanetMap & get_starting_planet (Planet planet) |
|
public inline const PlanetMap & get_earth_map () const |
|
public inline const PlanetMap & get_mars_map () const |
|
public inline unsigned get_karbonite () const |
|
public inline bool has_unit (unsigned id) const |
|
public inline Unit get_unit (unsigned id) const |
|
public inline std::vector< Unit > get_units () const |
|
public inline std::vector< Unit > get_my_units () const |
|
public inline std::vector< Unit > get_units_in_space () const |
|
public inline unsigned get_karbonite_at (const MapLocation & map_location) const |
|
public inline std::vector< MapLocation > get_all_locations_within (const MapLocation & map_location,unsigned radius_squared) const |
|
public inline bool can_sense_location (const MapLocation & map_location) const |
|
public inline bool can_sense_unit (unsigned id) const |
|
public inline std::vector< Unit > sense_nearby_units (const MapLocation & map_location,unsigned radius_squared) const |
|
public inline std::vector< Unit > sense_nearby_units_by_team (const MapLocation & map_location,unsigned radius_squared,Team team) const |
|
public inline std::vector< Unit > sense_nearby_units_by_type (const MapLocation & map_location,unsigned radius_squared,UnitType type) const |
|
public inline bool has_unit_at_location (const MapLocation & map_location) const |
|
public inline Unit sense_unit_at_location (const MapLocation & map_location) const |
|
public inline const AsteroidPattern & get_asteroid_pattern () const |
|
public inline const OrbitPattern & get_orbit_pattern () const |
|
public inline unsigned get_current_duration_of_flight () const |
|
public inline std::vector< int > get_team_array (Planet planet) const |
|
public inline void write_team_array (unsigned index,int value) const |
|
public inline void disintegrate_unit (unsigned id) const |
|
public inline bool is_occupiable (const MapLocation & map_location) const |
|
public inline bool can_move (unsigned id,Direction direction) const |
|
public inline bool is_move_ready (unsigned id) const |
|
public inline void move_robot (unsigned id,Direction direction) const |
|
public inline bool can_attack (unsigned id,unsigned target_id) const |
|
public inline bool is_attack_ready (unsigned id) const |
|
public inline void attack (unsigned id,unsigned target_id) const |
|
public inline ResearchInfo get_research_info () const |
|
public inline bool reset_research () const |
|
public inline bool queue_research (UnitType branch) const |
|
public inline bool can_harvest (unsigned id,Direction direction) const |
|
public inline void harvest (unsigned id,Direction direction) const |
|
public inline bool can_blueprint (unsigned id,UnitType unit_type,Direction direction) const |
|
public inline void blueprint (unsigned id,UnitType unit_type,Direction direction) const |
|
public inline bool can_build (unsigned worker_id,unsigned blueprint_id) const |
|
public inline void build (unsigned worker_id,unsigned blueprint_id) const |
|
public inline bool can_repair (unsigned worker_id,unsigned structure_id) const |
|
public inline void repair (unsigned worker_id,unsigned structure_id) const |
|
public inline bool can_replicate (unsigned worker_id,Direction direction) const |
|
public inline void replicate (unsigned worker_id,Direction direction) const |
|
public inline bool can_javelin (unsigned knight_id,unsigned target_id) const |
|
public inline bool is_javelin_ready (unsigned knight_id) const |
|
public inline void javelin (unsigned knight_id,unsigned target_id) const |
|
public inline bool can_begin_snipe (unsigned ranger_id,const MapLocation & map_location) const |
|
public inline void begin_snipe (unsigned ranger_id,const MapLocation & map_location) const |
|
public inline bool can_begin_blink (unsigned mage_id,const MapLocation & map_location) const |
|
public inline bool is_blink_ready (unsigned mage_id) const |
|
public inline void blink (unsigned mage_id,const MapLocation & map_location) const |
|
public inline bool can_heal (unsigned healer_id,unsigned target_id) const |
|
public inline bool is_heal_ready (unsigned healer_id) const |
|
public inline void heal (unsigned healer_id,unsigned target_id) const |
|
public inline bool is_overcharge_ready (unsigned healer_id) const |
|
public inline void overcharge (unsigned healer_id,unsigned target_id) const |
|
public inline bool can_load (unsigned structure_id,unsigned robot_id) const |
|
public inline void load (unsigned structure_id,unsigned robot_id) const |
|
public inline bool can_unload (unsigned structure_id,Direction direction) const |
|
public inline void unload (unsigned structure_id,Direction direction) const |
|
public inline bool can_produce_robot (unsigned factory_id,UnitType unit_type) const |
|
public inline void produce_robot (unsigned factory_id,UnitType unit_type) const |
|
public inline RocketLandingInfo get_rocket_landings () const |
|
public inline bool can_launch_rocket (unsigned rocket_id,const MapLocation & map_location) const |
|
public inline void launch_rocket (unsigned rocket_id,const MapLocation & map_location) const |
|
public inline unsigned get_time_left_ms () const |
|
public inline bool is_over () const |
|
public inline Team get_winning_team () const |
public inline
GameController
()
public inline
~GameController
()
public
GameController
(const
GameController
& that) = delete
public
GameController
&
operator=
(const
GameController
& that) = delete
public inline void
next_turn
() const
public inline unsigned
get_round
() const
public inline Planet
get_planet
() const
public inline Team
get_team
() const
public inline const
PlanetMap
&
get_starting_planet
(Planet planet)
public inline const
PlanetMap
&
get_earth_map
() const
public inline const
PlanetMap
&
get_mars_map
() const
public inline unsigned
get_karbonite
() const
public inline bool
has_unit
(unsigned id) const
public inline std::vector<
Unit
>
get_my_units
() const
public inline std::vector<
Unit
>
get_units_in_space
() const
public inline unsigned
get_karbonite_at
(const
MapLocation
& map_location) const
public inline std::vector<
MapLocation
>
get_all_locations_within
(const
MapLocation
& map_location,unsigned radius_squared) const
public inline bool
can_sense_location
(const
MapLocation
& map_location) const
public inline bool
can_sense_unit
(unsigned id) const
public inline std::vector<
Unit
>
sense_nearby_units
(const
MapLocation
& map_location,unsigned radius_squared) const
public inline std::vector<
Unit
>
sense_nearby_units_by_team
(const
MapLocation
& map_location,unsigned radius_squared,Team team) const
public inline std::vector<
Unit
>
sense_nearby_units_by_type
(const
MapLocation
& map_location,unsigned radius_squared,UnitType type) const
public inline bool
has_unit_at_location
(const
MapLocation
& map_location) const
public inline
Unit
sense_unit_at_location
(const
MapLocation
& map_location) const
public inline const
AsteroidPattern
&
get_asteroid_pattern
() const
public inline const
OrbitPattern
&
get_orbit_pattern
() const
public inline unsigned
get_current_duration_of_flight
() const
public inline std::vector< int >
get_team_array
(Planet planet) const
public inline void
write_team_array
(unsigned index,int value) const
public inline void
disintegrate_unit
(unsigned id) const
public inline bool
is_occupiable
(const
MapLocation
& map_location) const
public inline bool
can_move
(unsigned id,Direction direction) const
public inline bool
is_move_ready
(unsigned id) const
public inline void
move_robot
(unsigned id,Direction direction) const
public inline bool
can_attack
(unsigned id,unsigned target_id) const
public inline bool
is_attack_ready
(unsigned id) const
public inline void
attack
(unsigned id,unsigned target_id) const
public inline
ResearchInfo
get_research_info
() const
public inline bool
reset_research
() const
public inline bool
queue_research
(UnitType branch) const
public inline bool
can_harvest
(unsigned id,Direction direction) const
public inline void
harvest
(unsigned id,Direction direction) const
public inline bool
can_blueprint
(unsigned id,UnitType unit_type,Direction direction) const
public inline void
blueprint
(unsigned id,UnitType unit_type,Direction direction) const
public inline bool
can_build
(unsigned worker_id,unsigned blueprint_id) const
public inline void
build
(unsigned worker_id,unsigned blueprint_id) const
public inline bool
can_repair
(unsigned worker_id,unsigned structure_id) const
public inline void
repair
(unsigned worker_id,unsigned structure_id) const
public inline bool
can_replicate
(unsigned worker_id,Direction direction) const
public inline void
replicate
(unsigned worker_id,Direction direction) const
public inline bool
can_javelin
(unsigned knight_id,unsigned target_id) const
public inline bool
is_javelin_ready
(unsigned knight_id) const
public inline void
javelin
(unsigned knight_id,unsigned target_id) const
public inline bool
can_begin_snipe
(unsigned ranger_id,const
MapLocation
& map_location) const
public inline void
begin_snipe
(unsigned ranger_id,const
MapLocation
& map_location) const
public inline bool
can_begin_blink
(unsigned mage_id,const
MapLocation
& map_location) const
public inline bool
is_blink_ready
(unsigned mage_id) const
public inline void
blink
(unsigned mage_id,const
MapLocation
& map_location) const
public inline bool
can_heal
(unsigned healer_id,unsigned target_id) const
public inline bool
is_heal_ready
(unsigned healer_id) const
public inline void
heal
(unsigned healer_id,unsigned target_id) const
public inline bool
is_overcharge_ready
(unsigned healer_id) const
public inline void
overcharge
(unsigned healer_id,unsigned target_id) const
public inline bool
can_load
(unsigned structure_id,unsigned robot_id) const
public inline void
load
(unsigned structure_id,unsigned robot_id) const
public inline bool
can_unload
(unsigned structure_id,Direction direction) const
public inline void
unload
(unsigned structure_id,Direction direction) const
public inline bool
can_produce_robot
(unsigned factory_id,UnitType unit_type) const
public inline void
produce_robot
(unsigned factory_id,UnitType unit_type) const
public inline
RocketLandingInfo
get_rocket_landings
() const
public inline bool
can_launch_rocket
(unsigned rocket_id,const
MapLocation
& map_location) const
public inline void
launch_rocket
(unsigned rocket_id,const
MapLocation
& map_location) const
public inline unsigned
get_time_left_ms
() const
public inline bool
is_over
() const
public inline Team
get_winning_team
() const
Members | Descriptions |
---|---|
public inline Location () |
|
public inline Location (const MapLocation & map_location) |
|
public inline Location (unsigned garrison_id) |
|
public inline explicit Location (bc_Location * location) |
|
public inline bool is_on_map () const |
|
public inline bool is_on_planet (Planet planet) const |
|
public inline MapLocation get_map_location () const |
|
public inline bool is_in_garrison () const |
|
public inline int get_structure () const |
|
public inline bool is_in_space () const |
|
public inline bool is_adjacent_to ( Location location) |
|
public inline bool is_within_range (unsigned range, Location location) |
public inline
Location
()
public inline
Location
(const
MapLocation
& map_location)
public inline
Location
(unsigned garrison_id)
public inline explicit
Location
(bc_Location * location)
public inline bool
is_on_map
() const
public inline bool
is_on_planet
(Planet planet) const
public inline
MapLocation
get_map_location
() const
public inline bool
is_in_garrison
() const
public inline int
get_structure
() const
public inline bool
is_in_space
() const
public inline bool
is_adjacent_to
(
Location
location)
public inline bool
is_within_range
(unsigned range,
Location
location)
Two-dimensional coordinates in the Battlecode world.
Members | Descriptions |
---|---|
public inline MapLocation () |
Empty Constructor |
public inline MapLocation (Planet planet,int x,int y) |
Constructor |
public inline MapLocation (const MapLocation & map_location) |
Copy constructur |
public MapLocation ( MapLocation &&) = default |
Move constructor |
public inline MapLocation & operator= (const MapLocation & map_location) |
Assignment operator (deep copy) |
public MapLocation & operator= ( MapLocation &&) = default |
Assignment operator (move) |
public inline Planet get_planet () const |
Returns the planet the MapLocation is at |
public inline int get_x () const |
Returns the x coordinate |
public inline int get_y () const |
Returns the y coordinate |
public inline void set_planet (Planet planet) |
Set the planet |
public inline void set_x (int x) |
Set the x coordinate of the map location |
public inline void set_y (int y) |
Set the y coordinate of the map location |
public inline MapLocation add (Direction direction) const |
Returns the map location one square from this one in the given direction. |
public inline MapLocation subtract (Direction direction) const |
Returns the map location one square from this one in the opposite direction. |
public inline MapLocation add_multiple (Direction direction,int multiple) const |
Returns the map location multiple squares from this one in the given direction. |
public inline MapLocation translate (int dx,int dy) const |
The location translated from this location by dx in the x direction and dy in the y direction. |
public inline unsigned distance_squared_to (const MapLocation & map_location) const |
Computes the square of the distance from this location to the specified location. If on different planets, returns the maximum integer. |
public inline Direction direction_to (const MapLocation & map_location) const |
The Direction from this location to the specified location. |
public inline bool is_adjacent_to (const MapLocation & map_location) const |
Determines whether this location is adjacent to the specified location, including diagonally. Note that squares are not adjacent to themselves, and squares on different planets are not adjacent to each other. |
public inline bool is_within_range (unsigned range,const MapLocation & map_location) const |
Whether this location is within the distance squared range of the specified location, inclusive. False for locations on different planets. |
public inline bool operator== (const MapLocation & map_location) const |
Overloading of the == operator |
public inline bool operator!= (const MapLocation & map_location) const |
Overloading of the != operator |
public inline
MapLocation
()
Empty Constructor
public inline
MapLocation
(Planet planet,int x,int y)
Constructor
-
planet
-
x
-
y
public inline
MapLocation
(const
MapLocation
& map_location)
Copy constructur
map_location
public
MapLocation
(
MapLocation
&&) = default
Move constructor
map_location
public inline
MapLocation
&
operator=
(const
MapLocation
& map_location)
Assignment operator (deep copy)
map_location
the assigned MapLocation
public
MapLocation
&
operator=
(
MapLocation
&&) = default
Assignment operator (move)
map_location
the assigned MapLocation
public inline Planet
get_planet
() const
Returns the planet the MapLocation is at
the planet the MapLocation is at
public inline int
get_x
() const
Returns the x coordinate
the x coordinate
public inline int
get_y
() const
Returns the y coordinate
the y coordinate
public inline void
set_planet
(Planet planet)
Set the planet
planet
public inline void
set_x
(int x)
Set the x coordinate of the map location
x
public inline void
set_y
(int y)
Set the y coordinate of the map location
y
public inline
MapLocation
add
(Direction direction) const
Returns the map location one square from this one in the given direction.
direction
the map location one square from this one in the given direction.
public inline
MapLocation
subtract
(Direction direction) const
Returns the map location one square from this one in the opposite direction.
direction
the map location one square from this one in the opposite direction.
public inline
MapLocation
add_multiple
(Direction direction,int multiple) const
Returns the map location multiple
squares from this one in the given direction.
direction
Returns map the location multiple
squares from this one in the given direction.
public inline
MapLocation
translate
(int dx,int dy) const
The location translated from this location by dx
in the x direction and dy
in the y direction.
-
dx
-
dy
The location translated from this location by dx
in the x direction and dy
in the y direction.
public inline unsigned
distance_squared_to
(const
MapLocation
& map_location) const
Computes the square of the distance from this location to the specified location. If on different planets, returns the maximum integer.
map_location
the square of the distance from this location to the specified location. If on different planets, returns the maximum integer.
public inline Direction
direction_to
(const
MapLocation
& map_location) const
The Direction from this location to the specified location.
map_location
:
The Direction from this location to the specified location.
DifferentPlanet
The locations are on different planets.
public inline bool
is_adjacent_to
(const
MapLocation
& map_location) const
Determines whether this location is adjacent to the specified location, including diagonally. Note that squares are not adjacent to themselves, and squares on different planets are not adjacent to each other.
map_location
if this location is adjacent to the specified location
public inline bool
is_within_range
(unsigned range,const
MapLocation
& map_location) const
Whether this location is within the distance squared range of the specified location, inclusive. False for locations on different planets.
-
range
-
map_location
if this location is within the distance squared range of the specified location inclusive
public inline bool
operator==
(const
MapLocation
& map_location) const
Overloading of the == operator
map_location
if the current MapLocation is equal to map_location
public inline bool
operator!=
(const
MapLocation
& map_location) const
Overloading of the != operator
map_location
if the current MapLocation is not equal to map_location
Members | Descriptions |
---|---|
public inline OrbitPattern (bc_OrbitPattern * orbit_pattern) |
|
public inline unsigned get_amplitude () const |
|
public inline unsigned get_period () const |
|
public inline unsigned get_center () const |
|
public inline unsigned duration (unsigned round) const |
public inline
OrbitPattern
(bc_OrbitPattern * orbit_pattern)
public inline unsigned
get_amplitude
() const
public inline unsigned
get_period
() const
public inline unsigned
get_center
() const
public inline unsigned
duration
(unsigned round) const
Members | Descriptions |
---|---|
public inline PlanetMap () |
|
public inline PlanetMap (bc_PlanetMap * planet_map) |
|
public inline PlanetMap (const PlanetMap & planet_map) |
|
public PlanetMap ( PlanetMap && planet_map) = default |
|
public inline PlanetMap & operator= (const PlanetMap & planet_map) |
|
public PlanetMap & operator= ( PlanetMap && planet_map) = default |
|
public inline Planet get_planet () const |
|
public inline unsigned get_height () const |
|
public inline unsigned get_width () const |
|
public inline const std::vector< Unit > & get_initial_units () const |
|
public inline bool is_on_map (const MapLocation & location) const |
|
public inline bool is_passable_terrain_at (const MapLocation & map_location) const |
|
public inline unsigned get_initial_karbonite_at (const MapLocation & map_location) const |
|
public inline std::vector< std::vector< std::pair< bool, unsigned > > > get_initial_map () const |
Get the initial map passable and karbonite values. This information is constant, so it's useful to have it since the beginning and never use the API for this. |
public inline
PlanetMap
()
public inline
PlanetMap
(bc_PlanetMap * planet_map)
public inline Planet
get_planet
() const
public inline unsigned
get_height
() const
public inline unsigned
get_width
() const
public inline const std::vector<
Unit
> &
get_initial_units
() const
public inline bool
is_on_map
(const
MapLocation
& location) const
public inline bool
is_passable_terrain_at
(const
MapLocation
& map_location) const
public inline unsigned
get_initial_karbonite_at
(const
MapLocation
& map_location) const
public inline std::vector< std::vector< std::pair< bool, unsigned > > >
get_initial_map
() const
Get the initial map passable and karbonite values. This information is constant, so it's useful to have it since the beginning and never use the API for this.
the matrix of pair (is passable cell, initial karbonite at cell)
Members | Descriptions |
---|---|
public inline ResearchInfo (bc_ResearchInfo * info) |
|
public inline unsigned max_level (UnitType branch) const |
|
public inline unsigned cost_of (UnitType branch,unsigned level) const |
|
public inline unsigned get_level (UnitType branch) const |
|
public inline std::vector< UnitType > get_queue () const |
|
public inline bool has_next_in_queue () const |
|
public inline UnitType next_in_queue () const |
|
public inline unsigned rounds_left () const |
public inline
ResearchInfo
(bc_ResearchInfo * info)
public inline unsigned
max_level
(UnitType branch) const
public inline unsigned
cost_of
(UnitType branch,unsigned level) const
public inline unsigned
get_level
(UnitType branch) const
public inline std::vector< UnitType >
get_queue
() const
public inline bool
has_next_in_queue
() const
public inline UnitType
next_in_queue
() const
public inline unsigned
rounds_left
() const
Members | Descriptions |
---|---|
public inline RocketLanding (bc_RocketLanding * rocket_landing) |
|
public inline unsigned get_rocket_id () const |
|
public inline const MapLocation & get_destination () const |
public inline
RocketLanding
(bc_RocketLanding * rocket_landing)
public inline unsigned
get_rocket_id
() const
public inline const
MapLocation
&
get_destination
() const
Members | Descriptions |
---|---|
public inline explicit RocketLandingInfo (bc_RocketLandingInfo * rocket_landing_info) |
|
public inline std::vector< RocketLanding > get_landings_on_round (unsigned round) |
public inline explicit
RocketLandingInfo
(bc_RocketLandingInfo * rocket_landing_info)
public inline std::vector<
RocketLanding
>
get_landings_on_round
(unsigned round)
Members | Descriptions |
---|---|
public inline Unit () |
|
public inline explicit Unit (bc_Unit * unit) |
|
public inline Unit (const Unit & unit) |
|
public Unit ( Unit && unit) = default |
|
public inline Unit & operator= (const Unit & unit) |
|
public Unit & operator= ( Unit && unit) = default |
|
public inline UnitType get_unit_type () const |
|
public inline Team get_team () const |
|
public inline Location get_location () const |
|
public inline bool is_on_map () const |
|
public inline MapLocation get_map_location () const |
|
public inline unsigned get_id () const |
|
public inline unsigned get_health () const |
|
public inline unsigned get_max_health () const |
|
public inline unsigned get_vision_range () const |
|
public inline int get_damage () const |
|
public inline unsigned get_movement_heat () const |
|
public inline unsigned get_movement_cooldown () const |
|
public inline unsigned get_attack_heat () const |
|
public inline unsigned get_attack_cooldown () const |
|
public inline unsigned get_attack_range () const |
|
public inline unsigned get_ability_heat () const |
|
public inline unsigned get_ability_cooldown () const |
|
public inline unsigned get_ability_range () const |
|
public inline bool is_ability_unlocked () const |
|
public inline bool worker_has_acted () const |
|
public inline unsigned get_worker_build_health () const |
|
public inline unsigned get_worker_repair_health () const |
|
public inline unsigned get_worker_harvest_amount () const |
|
public inline unsigned get_knight_defense () const |
|
public inline unsigned get_ranger_cannot_attack_range () const |
|
public inline unsigned get_ranger_max_countdown () const |
|
public inline unsigned get_ranger_countdown () const |
|
public inline bool ranger_is_sniping () const |
|
public inline MapLocation get_ranger_target_location () const |
|
public inline unsigned get_healer_self_heal_amount () const |
|
public inline bool structure_is_built () const |
|
public inline unsigned get_structure_max_capacity () const |
|
public inline std::vector< unsigned > get_structure_garrison () const |
|
public inline bool is_factory_producing () const |
|
public inline UnitType get_factory_unit_type () const |
|
public inline unsigned get_factory_rounds_left () const |
|
public inline unsigned get_factory_max_rounds_left () const |
|
public inline bool rocket_is_used () const |
|
public inline int get_rocket_blast_damage () const |
|
public inline unsigned get_rocket_travel_time_decrease () const |
|
public inline bool is_structure () const |
|
public inline bool is_robot () const |
public inline
Unit
()
public inline explicit
Unit
(bc_Unit * unit)
public inline UnitType
get_unit_type
() const
public inline Team
get_team
() const
public inline
Location
get_location
() const
public inline bool
is_on_map
() const
public inline
MapLocation
get_map_location
() const
public inline unsigned
get_id
() const
public inline unsigned
get_health
() const
public inline unsigned
get_max_health
() const
public inline unsigned
get_vision_range
() const
public inline int
get_damage
() const
public inline unsigned
get_movement_heat
() const
public inline unsigned
get_movement_cooldown
() const
public inline unsigned
get_attack_heat
() const
public inline unsigned
get_attack_cooldown
() const
public inline unsigned
get_attack_range
() const
public inline unsigned
get_ability_heat
() const
public inline unsigned
get_ability_cooldown
() const
public inline unsigned
get_ability_range
() const
public inline bool
is_ability_unlocked
() const
public inline bool
worker_has_acted
() const
public inline unsigned
get_worker_build_health
() const
public inline unsigned
get_worker_repair_health
() const
public inline unsigned
get_worker_harvest_amount
() const
public inline unsigned
get_knight_defense
() const
public inline unsigned
get_ranger_cannot_attack_range
() const
public inline unsigned
get_ranger_max_countdown
() const
public inline unsigned
get_ranger_countdown
() const
public inline bool
ranger_is_sniping
() const
public inline
MapLocation
get_ranger_target_location
() const
public inline unsigned
get_healer_self_heal_amount
() const
public inline bool
structure_is_built
() const
public inline unsigned
get_structure_max_capacity
() const
public inline std::vector< unsigned >
get_structure_garrison
() const
public inline bool
is_factory_producing
() const
public inline UnitType
get_factory_unit_type
() const
public inline unsigned
get_factory_rounds_left
() const
public inline unsigned
get_factory_max_rounds_left
() const
public inline bool
rocket_is_used
() const
public inline int
get_rocket_blast_damage
() const
public inline unsigned
get_rocket_travel_time_decrease
() const
public inline bool
is_structure
() const
public inline bool
is_robot
() const
Generated by Moxygen