Struct sc2::GameState
[−]
[src]
pub struct GameState { pub player_id: u32, pub previous_step: u32, pub current_step: u32, pub camera_pos: Point2, pub units: Vec<Rc<Unit>>, pub power_sources: Vec<PowerSource>, pub effects: Vec<Effect>, pub upgrades: Vec<Upgrade>, pub minerals: u32, pub vespene: u32, pub food_cap: u32, pub food_used: u32, pub food_army: u32, pub food_workers: u32, pub idle_worker_count: u32, pub army_count: u32, pub warp_gate_count: u32, pub larva_count: u32, pub score: Score, }
state of the game (changes every frame)
Fields
player_id: u32
the player id associated with the participant
previous_step: u32
the previous game step
current_step: u32
the current game step
camera_pos: Point2
position of the center of the camera
units: Vec<Rc<Unit>>
a list of all known units at the moment
power_sources: Vec<PowerSource>
all power sources associated with the current player
effects: Vec<Effect>
all active effects in vision of the current player
upgrades: Vec<Upgrade>
all upgrades
minerals: u32
current mineral count
vespene: u32
current vespene count
food_cap: u32
the total supply cap given the players max supply
food_used: u32
the total supply used by the player
food_army: u32
the total supply consumed by army units alone
food_workers: u32
the total supply consumed by workers alone
idle_worker_count: u32
the number of workers that currently have no orders
army_count: u32
the number of army units
warp_gate_count: u32
the number of warp gates owned by the player
larva_count: u32
the number of larva owned by the player
score: Score
detailed current set of scores
Methods
impl GameState
[src]
fn filter_units<F>(&self, filter: F) -> Vec<Rc<Unit>> where
F: Fn(&Unit) -> bool,
[src]
F: Fn(&Unit) -> bool,
filter all units based on a custom condition
fn has_creep(&self, _: Point2) -> bool
[src]
check if the given point contains creep
fn get_visibility(&self, _: Point2) -> Visibility
[src]
get the visibility of the given point for the current player
fn is_pathable(&self, _: Point2) -> bool
[src]
whether the given point on the terrain is pathable
this does not include pathing blockers like structures, for more accurate pathing results, use query interface
fn is_placable(&self, _: Point2) -> bool
[src]
whether the given point on the terrain is buildable
this does not include blockers like other structures. for more accurate building placement results, use query interface
fn get_terrain_height(&self, _: Point2) -> f32
[src]
returns the terrain height of the given point