pub struct Game { /* private fields */ }
Implementations§
source§impl Game
impl Game
pub fn can_research(&self, checker: impl CanResearch) -> BwResult<bool>
pub fn can_upgrade(&self, checker: impl CanUpgrade) -> BwResult<bool>
source§impl Game
impl Game
pub fn send_text_ex(&self, to_allies: bool, message: &str)
pub fn send_text(&self, message: &str)
pub fn set_map(&self, map_file_name: &str) -> Result<(), Error>
pub fn draw_text_screen<P: Into<Position>>(&self, position: P, string: &str)
pub fn draw_text_map<P: Into<Position>>(&self, position: P, string: &str)
pub fn draw_text_mouse<P: Into<Position>>(&self, position: P, string: &str)
pub fn draw_text<P: Into<Position>>( &self, ctype: CoordinateType, position: P, string: &str )
pub fn draw_line_screen<P: Into<Position>>(&self, a: P, b: P, color: Color)
pub fn draw_line_map<P: Into<Position>>(&self, a: P, b: P, color: Color)
pub fn draw_line_mouse<P: Into<Position>>(&self, a: P, b: P, color: Color)
pub fn draw_dot_screen<P: Into<Position>>(&self, p: P, color: Color)
pub fn draw_dot_map<P: Into<Position>>(&self, p: P, color: Color)
pub fn draw_dot_mouse<P: Into<Position>>(&self, p: P, color: Color)
pub fn draw_dot<P: Into<Position>>( &self, ctype: CoordinateType, p: P, color: Color )
pub fn draw_triangle_map<P: Into<Position>>( &self, a: P, b: P, c: P, color: Color, solid: bool )
pub fn draw_triangle_mouse<P: Into<Position>>( &self, a: P, b: P, c: P, color: Color, solid: bool )
pub fn draw_triangle_screen<P: Into<Position>>( &self, a: P, b: P, c: P, color: Color, solid: bool )
pub fn draw_triangle<P: Into<Position>>( &self, ctype: CoordinateType, a: P, b: P, c: P, color: Color, solid: bool )
pub fn draw_circle_map<P: Into<Position>>( &self, p: P, radius: i32, color: Color, solid: bool )
pub fn draw_circle_screen<P: Into<Position>>( &self, p: P, radius: i32, color: Color, solid: bool )
pub fn draw_circle_mouse<P: Into<Position>>( &self, p: P, radius: i32, color: Color, solid: bool )
pub fn draw_circle<P: Into<Position>>( &self, ctype: CoordinateType, p: P, radius: i32, color: Color, solid: bool )
pub fn draw_ellipse_screen<P: Into<Position>>( &self, p: P, xrad: i32, yrad: i32, color: Color, solid: bool )
pub fn draw_ellipse_map<P: Into<Position>>( &self, p: P, xrad: i32, yrad: i32, color: Color, solid: bool )
pub fn draw_ellipse_mouse<P: Into<Position>>( &self, p: P, xrad: i32, yrad: i32, color: Color, solid: bool )
pub fn draw_ellipse<P: Into<Position>>( &self, ctype: CoordinateType, p: P, xrad: i32, yrad: i32, color: Color, solid: bool )
pub fn draw_line<P: Into<Position>>( &self, ctype: CoordinateType, a: P, b: P, color: Color )
pub fn draw_box_map<P: Into<Position>>( &self, top_left: P, bottom_right: P, color: Color, solid: bool )
pub fn draw_box_mouse<P: Into<Position>>( &self, top_left: P, bottom_right: P, color: Color, solid: bool )
pub fn draw_box_screen<P: Into<Position>>( &self, top_left: P, bottom_right: P, color: Color, solid: bool )
pub fn draw_box<P: Into<Position>>( &self, ctype: CoordinateType, top_left: P, bottom_right: P, color: Color, solid: bool )
pub fn issue_command(&self, cmd: UnitCommand)
pub fn set_alliance( &mut self, other: &Player, allied: bool, allied_victory: bool )
pub fn set_reveal_all(&mut self, reveal: bool) -> Result<(), Error>
pub fn set_vision( &mut self, player: &Player, enabled: bool ) -> Result<(), Error>
pub fn leave_game(&self)
pub fn pause_game(&self)
pub fn ping_minimap<P: Into<Position>>(&mut self, p: P)
pub fn restart_game(&mut self)
pub fn enable_flag(&mut self, flag: i32)
pub fn set_frame_skip(&mut self, frame_skip: i32)
pub fn set_gui(&mut self, enabled: bool)
pub fn set_lat_com(&mut self, enabled: bool)
pub fn set_local_speed(&mut self, speed: i32)
source§impl Game
impl Game
pub fn get_unit(&self, id: UnitId) -> Option<Unit>
pub fn get_static_geysers(&self) -> Vec<Unit>
pub fn get_static_minerals(&self) -> Vec<Unit>
pub fn get_static_neutral_units(&self) -> Vec<Unit>
pub fn get_all_units(&self) -> Vec<Unit>
pub fn get_selected_units(&self) -> Vec<Unit>
pub fn get_closest_unit<P: Into<Position>, Pred: IntoPredicate<Unit>, R: Into<Option<u32>>>( &self, center: P, pred: Pred, radius: R ) -> Option<Unit>
pub fn get_units_in_rectangle<A: Into<Position>, B: Into<Position>, P: IntoPredicate<Unit>>( &self, lt: A, rb: B, pred: P ) -> Vec<Unit>
pub fn get_player(&self, i: PlayerId) -> Option<Player>
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>
pub fn get_bullets(&self) -> Vec<Bullet>
pub fn get_region_at<P: Into<Position>>(&self, p: P) -> Option<Region>
pub fn get_region(&self, id: u16) -> Option<Region>
pub fn get_force(&self, force_id: i32) -> Force
pub fn get_forces(&self) -> Vec<Force>
pub fn neutral(&self) -> Player
pub fn get_players(&self) -> Vec<Player>
pub fn get_geysers(&self) -> Vec<Unit>
pub fn get_units_in_radius<P: Into<Position>, Pred: IntoPredicate<Unit>>( &self, position: P, radius: i32, pred: Pred ) -> Vec<Unit>
pub fn get_units_on_tile<TP: Into<TilePosition>, P: IntoPredicate<Unit>>( &self, tile: TP, pred: P ) -> Vec<Unit>
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>
pub fn has_path<S: Into<Position>, D: Into<Position>>( &self, source: S, destination: D ) -> bool
pub fn observers(&self) -> Vec<Player>
pub fn enemies(&self) -> Vec<Player>
pub fn can_command(&self, this_unit: &Unit) -> Result<bool, Error>
pub fn can_make<'a, B: Into<Option<&'a Unit>>>( &'a self, builder: B, type_: UnitType ) -> BwResult<bool>
pub fn allies(&self) -> Vec<Player>
pub fn enemy(&self) -> Option<Player>
pub fn self_(&self) -> Option<Player>
pub fn is_in_game(&self) -> bool
pub fn countdown_timer(&self) -> i32
pub fn elapsed_time(&self) -> i32
pub fn get_average_fps(&self) -> f64
pub fn has_power<TP: Into<TilePosition>, TS: Into<TilePosition>>( &self, position: TP, size: TS ) -> bool
pub fn has_power_precise<P: Into<Position>>(&self, position: P) -> bool
pub fn is_battle_net(&self) -> bool
pub fn is_debug(&self) -> bool
pub fn is_multiplayer(&self) -> bool
pub fn is_walkable<P: Into<WalkPosition>>(&self, wp: P) -> bool
pub fn is_visible<P: Into<TilePosition>>(&self, tp: P) -> bool
pub fn is_buildable<P: Into<TilePosition>>(&self, tp: P) -> bool
pub fn is_explored<P: Into<TilePosition>>(&self, tp: P) -> bool
pub fn is_gui_enabled(&self) -> bool
pub fn is_flag_enabled(&self, flag: Flag) -> bool
pub fn is_lat_com_enabled(&self) -> bool
pub fn is_paused(&self) -> bool
pub fn is_replay(&self) -> bool
pub fn has_creep<P: Into<TilePosition>>(&self, tp: P) -> bool
pub fn get_ground_height<P: Into<TilePosition>>(&self, tp: P) -> i32
pub fn get_instance_number(&self) -> i32
pub fn get_key_state(&self, key: Key) -> bool
pub fn get_latency(&self) -> i32
pub fn get_latency_frames(&self) -> i32
pub fn get_latency_time(&self) -> i32
pub fn get_mouse_position(&self) -> Position
pub fn get_mouse_state(&self, button: MouseButton) -> bool
pub fn map_height(&self) -> i32
pub fn map_width(&self) -> i32
pub fn map_hash(&self) -> String
pub fn map_file_name(&self) -> String
pub fn map_path_name(&self) -> String
pub fn map_name(&self) -> String
pub fn get_client_version(&self) -> i32
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
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
pub fn get_events(&self) -> Vec<BWAPIC_Event>
pub fn get_fps(&self) -> i32
pub fn get_frame_count(&self) -> i32
pub fn get_nuke_dots(&self) -> Vec<Position>
pub fn get_random_seed(&self) -> u32
pub fn get_remaining_latency_frames(&self) -> i32
pub fn get_remaining_latency_time(&self) -> i32
pub fn get_replay_frame_count(&self) -> i32
pub fn get_revision(&self) -> i32
pub fn get_screen_position(&self) -> Position
pub fn get_start_locations(&self) -> Vec<TilePosition>
Trait Implementations§
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more