Struct rsbwapi::game::Game

source ·
pub struct Game { /* private fields */ }

Implementations§

source§

impl Game

source

pub fn can_research(&self, checker: impl CanResearch) -> BwResult<bool>

source

pub fn can_upgrade(&self, checker: impl CanUpgrade) -> BwResult<bool>

source§

impl Game

source

pub fn send_text_ex(&self, to_allies: bool, message: &str)

source

pub fn send_text(&self, message: &str)

source

pub fn set_map(&self, map_file_name: &str) -> Result<(), Error>

source

pub fn draw_text_screen<P: Into<Position>>(&self, position: P, string: &str)

source

pub fn draw_text_map<P: Into<Position>>(&self, position: P, string: &str)

source

pub fn draw_text_mouse<P: Into<Position>>(&self, position: P, string: &str)

source

pub fn draw_text<P: Into<Position>>( &self, ctype: CoordinateType, position: P, string: &str )

source

pub fn draw_line_screen<P: Into<Position>>(&self, a: P, b: P, color: Color)

source

pub fn draw_line_map<P: Into<Position>>(&self, a: P, b: P, color: Color)

source

pub fn draw_line_mouse<P: Into<Position>>(&self, a: P, b: P, color: Color)

source

pub fn draw_dot_screen<P: Into<Position>>(&self, p: P, color: Color)

source

pub fn draw_dot_map<P: Into<Position>>(&self, p: P, color: Color)

source

pub fn draw_dot_mouse<P: Into<Position>>(&self, p: P, color: Color)

source

pub fn draw_dot<P: Into<Position>>( &self, ctype: CoordinateType, p: P, color: Color )

source

pub fn draw_triangle_map<P: Into<Position>>( &self, a: P, b: P, c: P, color: Color, solid: bool )

source

pub fn draw_triangle_mouse<P: Into<Position>>( &self, a: P, b: P, c: P, color: Color, solid: bool )

source

pub fn draw_triangle_screen<P: Into<Position>>( &self, a: P, b: P, c: P, color: Color, solid: bool )

source

pub fn draw_triangle<P: Into<Position>>( &self, ctype: CoordinateType, a: P, b: P, c: P, color: Color, solid: bool )

source

pub fn draw_circle_map<P: Into<Position>>( &self, p: P, radius: i32, color: Color, solid: bool )

source

pub fn draw_circle_screen<P: Into<Position>>( &self, p: P, radius: i32, color: Color, solid: bool )

source

pub fn draw_circle_mouse<P: Into<Position>>( &self, p: P, radius: i32, color: Color, solid: bool )

source

pub fn draw_circle<P: Into<Position>>( &self, ctype: CoordinateType, p: P, radius: i32, color: Color, solid: bool )

source

pub fn draw_ellipse_screen<P: Into<Position>>( &self, p: P, xrad: i32, yrad: i32, color: Color, solid: bool )

source

pub fn draw_ellipse_map<P: Into<Position>>( &self, p: P, xrad: i32, yrad: i32, color: Color, solid: bool )

source

pub fn draw_ellipse_mouse<P: Into<Position>>( &self, p: P, xrad: i32, yrad: i32, color: Color, solid: bool )

source

pub fn draw_ellipse<P: Into<Position>>( &self, ctype: CoordinateType, p: P, xrad: i32, yrad: i32, color: Color, solid: bool )

source

pub fn draw_line<P: Into<Position>>( &self, ctype: CoordinateType, a: P, b: P, color: Color )

source

pub fn draw_box_map<P: Into<Position>>( &self, top_left: P, bottom_right: P, color: Color, solid: bool )

source

pub fn draw_box_mouse<P: Into<Position>>( &self, top_left: P, bottom_right: P, color: Color, solid: bool )

source

pub fn draw_box_screen<P: Into<Position>>( &self, top_left: P, bottom_right: P, color: Color, solid: bool )

source

pub fn draw_box<P: Into<Position>>( &self, ctype: CoordinateType, top_left: P, bottom_right: P, color: Color, solid: bool )

source

pub fn issue_command(&self, cmd: UnitCommand)

source

pub fn set_alliance( &mut self, other: &Player, allied: bool, allied_victory: bool )

source

pub fn set_reveal_all(&mut self, reveal: bool) -> Result<(), Error>

source

pub fn set_vision( &mut self, player: &Player, enabled: bool ) -> Result<(), Error>

source

pub fn leave_game(&self)

source

pub fn pause_game(&self)

source

pub fn ping_minimap<P: Into<Position>>(&mut self, p: P)

source

pub fn restart_game(&mut self)

source

pub fn enable_flag(&mut self, flag: i32)

source

pub fn set_frame_skip(&mut self, frame_skip: i32)

source

pub fn set_gui(&mut self, enabled: bool)

source

pub fn set_lat_com(&mut self, enabled: bool)

source

pub fn set_local_speed(&mut self, speed: i32)

source§

impl Game

source

pub fn get_unit(&self, id: UnitId) -> Option<Unit>

source

pub fn get_static_geysers(&self) -> Vec<Unit>

source

pub fn get_static_minerals(&self) -> Vec<Unit>

source

pub fn get_static_neutral_units(&self) -> Vec<Unit>

source

pub fn get_all_units(&self) -> Vec<Unit>

source

pub fn get_selected_units(&self) -> Vec<Unit>

source

pub fn get_closest_unit<P: Into<Position>, Pred: IntoPredicate<Unit>, R: Into<Option<u32>>>( &self, center: P, pred: Pred, radius: R ) -> Option<Unit>

source

pub fn get_units_in_rectangle<A: Into<Position>, B: Into<Position>, P: IntoPredicate<Unit>>( &self, lt: A, rb: B, pred: P ) -> Vec<Unit>

source

pub fn get_player(&self, i: PlayerId) -> Option<Player>

source

pub fn get_closest_unit_in_rectangle<P: Into<Position>, Pred: IntoPredicate<Unit>, R: Into<Rectangle<Position>>>( &self, center: P, pred: Pred, rectangle: R ) -> Option<Unit>

source

pub fn get_bullets(&self) -> Vec<Bullet>

source

pub fn get_region_at<P: Into<Position>>(&self, p: P) -> Option<Region>

source

pub fn get_region(&self, id: u16) -> Option<Region>

source

pub fn get_force(&self, force_id: i32) -> Force

source

pub fn get_forces(&self) -> Vec<Force>

source

pub fn neutral(&self) -> Player

source

pub fn get_players(&self) -> Vec<Player>

source

pub fn get_geysers(&self) -> Vec<Unit>

source

pub fn get_units_in_radius<P: Into<Position>, Pred: IntoPredicate<Unit>>( &self, position: P, radius: i32, pred: Pred ) -> Vec<Unit>

source

pub fn get_units_on_tile<TP: Into<TilePosition>, P: IntoPredicate<Unit>>( &self, tile: TP, pred: P ) -> Vec<Unit>

source

pub fn can_build_here<'a, P: Into<TilePosition>, B: Into<Option<&'a Unit>>>( &'a self, builder: B, position: P, type_: UnitType, check_explored: bool ) -> BwResult<bool>

source

pub fn has_path<S: Into<Position>, D: Into<Position>>( &self, source: S, destination: D ) -> bool

source

pub fn observers(&self) -> Vec<Player>

source

pub fn enemies(&self) -> Vec<Player>

source

pub fn can_command(&self, this_unit: &Unit) -> Result<bool, Error>

source

pub fn can_make<'a, B: Into<Option<&'a Unit>>>( &'a self, builder: B, type_: UnitType ) -> BwResult<bool>

source

pub fn allies(&self) -> Vec<Player>

source

pub fn enemy(&self) -> Option<Player>

source

pub fn self_(&self) -> Option<Player>

source

pub fn is_in_game(&self) -> bool

source

pub fn countdown_timer(&self) -> i32

source

pub fn elapsed_time(&self) -> i32

source

pub fn get_average_fps(&self) -> f64

source

pub fn has_power<TP: Into<TilePosition>, TS: Into<TilePosition>>( &self, position: TP, size: TS ) -> bool

source

pub fn has_power_precise<P: Into<Position>>(&self, position: P) -> bool

source

pub fn is_battle_net(&self) -> bool

source

pub fn is_debug(&self) -> bool

source

pub fn is_multiplayer(&self) -> bool

source

pub fn is_walkable<P: Into<WalkPosition>>(&self, wp: P) -> bool

source

pub fn is_visible<P: Into<TilePosition>>(&self, tp: P) -> bool

source

pub fn is_buildable<P: Into<TilePosition>>(&self, tp: P) -> bool

source

pub fn is_explored<P: Into<TilePosition>>(&self, tp: P) -> bool

source

pub fn is_gui_enabled(&self) -> bool

source

pub fn is_flag_enabled(&self, flag: Flag) -> bool

source

pub fn is_lat_com_enabled(&self) -> bool

source

pub fn is_paused(&self) -> bool

source

pub fn is_replay(&self) -> bool

source

pub fn has_creep<P: Into<TilePosition>>(&self, tp: P) -> bool

source

pub fn get_ground_height<P: Into<TilePosition>>(&self, tp: P) -> i32

source

pub fn get_instance_number(&self) -> i32

source

pub fn get_key_state(&self, key: Key) -> bool

source

pub fn get_latency(&self) -> i32

source

pub fn get_latency_frames(&self) -> i32

source

pub fn get_latency_time(&self) -> i32

source

pub fn get_mouse_position(&self) -> Position

source

pub fn get_mouse_state(&self, button: MouseButton) -> bool

source

pub fn map_height(&self) -> i32

source

pub fn map_width(&self) -> i32

source

pub fn map_hash(&self) -> String

source

pub fn map_file_name(&self) -> String

source

pub fn map_path_name(&self) -> String

source

pub fn map_name(&self) -> String

source

pub fn get_client_version(&self) -> i32

source

pub fn get_damage_from<P1: Into<Option<Player>>, P2: Into<Option<Player>>>( &self, from_type: UnitType, to_type: UnitType, from_player: P1, to_player: P2 ) -> i32

source

pub fn get_damage_to<P1: Into<Option<Player>>, P2: Into<Option<Player>>>( &self, to_type: UnitType, from_type: UnitType, to_player: P2, from_player: P1 ) -> i32

source

pub fn get_events(&self) -> Vec<BWAPIC_Event>

source

pub fn get_fps(&self) -> i32

source

pub fn get_frame_count(&self) -> i32

source

pub fn get_nuke_dots(&self) -> Vec<Position>

source

pub fn get_random_seed(&self) -> u32

source

pub fn get_remaining_latency_frames(&self) -> i32

source

pub fn get_remaining_latency_time(&self) -> i32

source

pub fn get_replay_frame_count(&self) -> i32

source

pub fn get_revision(&self) -> i32

source

pub fn get_screen_position(&self) -> Position

source

pub fn get_start_locations(&self) -> Vec<TilePosition>

Trait Implementations§

source§

impl Clone for Game

source§

fn clone(&self) -> Game

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl PositionValidator for &Game

source§

fn is_valid<const N: i32>(&self, pos: ScaledPosition<N>) -> bool

Auto Trait Implementations§

§

impl !RefUnwindSafe for Game

§

impl !Send for Game

§

impl !Sync for Game

§

impl Unpin for Game

§

impl !UnwindSafe for Game

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.