rust_sc2

Struct PlayerSettings

Source
pub struct PlayerSettings<'a> {
    pub race: Race,
    pub name: Option<&'a str>,
    pub raw_affects_selection: bool,
    pub raw_crop_to_playable_area: bool,
}
Expand description

Settings that must be provided by a player when joining a game.

if name is None, it’ll be shown as “foo(whatever)” in game.

if raw_affects_selection is true, bot will select units to which it gives orders.

if raw_crop_to_playable_area is true, maps will be crooped to the size of self.game_info.playable_area.

Defaults: name: None raw_affects_selection: false raw_crop_to_playable_area: false

Fields§

§race: Race§name: Option<&'a str>§raw_affects_selection: bool§raw_crop_to_playable_area: bool

Implementations§

Source§

impl<'a> PlayerSettings<'a>

Source

pub fn new(race: Race) -> Self

Constructs new settings with given Race.

Source

pub fn with_name(self, name: &'a str) -> Self

Sets name of the player.

Source

pub fn raw_affects_selection(self, val: bool) -> Self

Sets raw_affects_selection to a given value.

Source

pub fn raw_crop_to_playable_area(self, val: bool) -> Self

Sets raw_crop_to_playable_area to a given value.

Trait Implementations§

Source§

impl Default for PlayerSettings<'_>

Source§

fn default() -> Self

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

Auto Trait Implementations§

§

impl<'a> Freeze for PlayerSettings<'a>

§

impl<'a> RefUnwindSafe for PlayerSettings<'a>

§

impl<'a> Send for PlayerSettings<'a>

§

impl<'a> Sync for PlayerSettings<'a>

§

impl<'a> Unpin for PlayerSettings<'a>

§

impl<'a> UnwindSafe for PlayerSettings<'a>

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