rust_sc2::debug

Struct Debugger

Source
pub struct Debugger { /* private fields */ }
Expand description

Helper struct for interacting with Debug API. Can be accessed through debug field of bot.

Implementations§

Source§

impl Debugger

Source

pub fn draw_text_world( &mut self, text: &str, pos: Point3, color: Option<(u32, u32, u32)>, size: Option<u32>, )

Draws text in game world with 3d coordinates.

Source

pub fn draw_text_screen( &mut self, text: &str, pos: Option<(f32, f32)>, color: Option<(u32, u32, u32)>, size: Option<u32>, )

Draws text in game window with 2d coordinates, where (0, 0) is left upper corner.

Source

pub fn draw_line( &mut self, p0: Point3, p1: Point3, color: Option<(u32, u32, u32)>, )

Draws line in game world from p0 to p1.

Source

pub fn draw_box( &mut self, p0: Point3, p1: Point3, color: Option<(u32, u32, u32)>, )

Draws box in game world with corners p0 and p1.

Source

pub fn draw_cube( &mut self, pos: Point3, half_edge: f32, color: Option<(u32, u32, u32)>, )

Draws cube in game world with given half size of edge.

Source

pub fn draw_sphere( &mut self, pos: Point3, radius: f32, color: Option<(u32, u32, u32)>, )

Draws sphere in game world with given radius.

Source

pub fn create_units<'a, T>(&mut self, cmds: T)
where T: IntoIterator<Item = &'a (UnitTypeId, Option<u32>, Point2, u32)>,

Spawns units using given commands in format: (unit type, owner’s player id, position, count).

Source

pub fn kill_units<'a, T: IntoIterator<Item = &'a u64>>(&mut self, tags: T)

Kills units with given tags.

Source

pub fn set_unit_values<'a, T>(&mut self, cmds: T)
where T: IntoIterator<Item = &'a (u64, UnitValue, u32)>,

Sets values for units using given commands in format: (unit tag, value type, value).

Source

pub fn win_game(&mut self)

Ends game with Victory for bot

Source

pub fn end_game(&mut self)

Ends game with Defeat for bot

Source

pub fn show_map(&mut self)

Disables fog of war, makes all map visible

Source

pub fn control_enemy(&mut self)

Gives ability to control enemy units

Source

pub fn cheat_supply(&mut self)

Disables supply usage

Source

pub fn cheat_free_build(&mut self)

Makes free all units, structures and upgrades

Source

pub fn cheat_resources(&mut self)

Gives 5000 minerals and gas to the bot

Source

pub fn cheat_minerals(&mut self)

Gives 5000 minerals to the bot

Source

pub fn cheat_gas(&mut self)

Gives 5000 gas to the bot

Source

pub fn cheat_god(&mut self)

Makes all bot’s units invincible and significantly increases their damage

Source

pub fn cheat_cooldown(&mut self)

Removes cooldown of abilities of bot’s units

Source

pub fn cheat_tech_tree(&mut self)

Removes all tech requirements for bot

Source

pub fn cheat_upgrades(&mut self)

First use: researches all upgrades for units and sets level 1 of damage and armor upgrades

Second use: sets level 2 of damage and armor upgrades

Third use: sets level 3 of damage and armor upgrades

Fourth use: disables all upgrades researched with this command

Source

pub fn cheat_fast_build(&mut self)

Significantly increases speed of making units, structures and upgrades

Trait Implementations§

Source§

impl Default for Debugger

Source§

fn default() -> Debugger

Returns the “default value” for a type. Read more

Auto Trait Implementations§

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> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

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>,

Source§

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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V