Struct sc2::observer::Observation [−][src]
pub struct Observation { /* fields omitted */ }
State of the game (changes every frame).
Methods
impl Observation
[src]
impl Observation
pub fn get_player_id(&self) -> u32
[src]
pub fn get_player_id(&self) -> u32
The player id associated with the participant.
pub fn get_previous_step(&self) -> u32
[src]
pub fn get_previous_step(&self) -> u32
The previous game step.
pub fn get_current_step(&self) -> u32
[src]
pub fn get_current_step(&self) -> u32
The current game step.
pub fn get_camera_pos(&self) -> Point2
[src]
pub fn get_camera_pos(&self) -> Point2
Position of the center of the camera.
pub fn get_units(&self) -> &[Rc<Unit>]
[src]
pub fn get_units(&self) -> &[Rc<Unit>]
A list of all known units at the moment.
pub fn get_power_sources(&self) -> &[PowerSource]
[src]
pub fn get_power_sources(&self) -> &[PowerSource]
All power sources associated with the current player.
pub fn get_effects(&self) -> &[Effect]
[src]
pub fn get_effects(&self) -> &[Effect]
All active effects in vision of the current player.
pub fn get_upgrades(&self) -> &[Upgrade]
[src]
pub fn get_upgrades(&self) -> &[Upgrade]
All upgrades.
pub fn get_minerals(&self) -> u32
[src]
pub fn get_minerals(&self) -> u32
Current mineral count.
pub fn get_vespene(&self) -> u32
[src]
pub fn get_vespene(&self) -> u32
Current vespene count.
pub fn get_food_cap(&self) -> u32
[src]
pub fn get_food_cap(&self) -> u32
The total supply cap given the players max supply.
pub fn get_food_used(&self) -> u32
[src]
pub fn get_food_used(&self) -> u32
The total supply used by the player.
pub fn get_food_army(&self) -> u32
[src]
pub fn get_food_army(&self) -> u32
The total supply consumed by army units alone.
pub fn get_food_workers(&self) -> u32
[src]
pub fn get_food_workers(&self) -> u32
The total supply consumed by workers alone.
pub fn get_idle_worker_count(&self) -> u32
[src]
pub fn get_idle_worker_count(&self) -> u32
The number of workers that currently have no orders.
pub fn get_army_count(&self) -> u32
[src]
pub fn get_army_count(&self) -> u32
The number of army units.
pub fn get_warp_gate_count(&self) -> u32
[src]
pub fn get_warp_gate_count(&self) -> u32
The number of warp gates owned by the player.
pub fn get_larva_count(&self) -> u32
[src]
pub fn get_larva_count(&self) -> u32
The number of larva owned by the player.
pub fn get_creep(&self) -> &ImageData
[src]
pub fn get_creep(&self) -> &ImageData
Creep image (sample pixels to find tiles with creep).
pub fn get_visibility(&self) -> &ImageData
[src]
pub fn get_visibility(&self) -> &ImageData
Visibility image (sample pixels to find visible tiles).
pub fn get_score(&self) -> &Score
[src]
pub fn get_score(&self) -> &Score
Detailed current set of scores.
pub fn filter_units<F>(&self, filter: F) -> Vec<Rc<Unit>> where
F: Fn(&Unit) -> bool,
[src]
pub fn filter_units<F>(&self, filter: F) -> Vec<Rc<Unit>> where
F: Fn(&Unit) -> bool,
Filter all units based on a custom condition.
pub fn sample_creep(&self, _: Point2) -> bool
[src]
pub fn sample_creep(&self, _: Point2) -> bool
Check if the given point contains creep.
pub fn sample_visibility(&self, _: Point2) -> Visibility
[src]
pub fn sample_visibility(&self, _: Point2) -> Visibility
Get the visibility of the given point for the current player.
Trait Implementations
impl Debug for Observation
[src]
impl Debug for Observation
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Clone for Observation
[src]
impl Clone for Observation
fn clone(&self) -> Observation
[src]
fn clone(&self) -> Observation
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
Auto Trait Implementations
impl !Send for Observation
impl !Send for Observation
impl !Sync for Observation
impl !Sync for Observation