rust_sc2::client

Struct RunnerMulti

Source
pub struct RunnerMulti<'a, B>
where B: Player + DerefMut<Target = Bot> + Deref<Target = Bot>,
{ pub human_settings: PlayerSettings<'a>, pub realtime: bool, pub save_replay_as: Option<&'a str>, /* private fields */ }
Expand description

Runner for games vs Human.

Fields§

§human_settings: PlayerSettings<'a>

Configuration of human opponent.

§realtime: bool

Play games in real time mode or not.

§save_replay_as: Option<&'a str>

Save replay after the game in given path.

Implementations§

Source§

impl<'a, B> RunnerMulti<'a, B>
where B: Player + DerefMut<Target = Bot> + Deref<Target = Bot>,

Source

pub fn new( bot: &'a mut B, human_settings: PlayerSettings<'a>, map: &str, sc2_version: Option<&'a str>, ) -> Self

Constructs new multi player runner.

Source

pub fn launch(&mut self) -> SC2Result<()>

Launches SC2 clients and connects bot to the API.

Source

pub fn run_game(&mut self) -> SC2Result<()>

Runs requested game.

Source

pub fn set_map(&mut self, map: &str)

Changes map to play on.

§Panics

Panics if the map doesn’t exist in maps directory.

Source

pub fn close(&mut self)

Manually closes SC2 clients.

Auto Trait Implementations§

§

impl<'a, B> !Freeze for RunnerMulti<'a, B>

§

impl<'a, B> !RefUnwindSafe for RunnerMulti<'a, B>

§

impl<'a, B> Send for RunnerMulti<'a, B>
where B: Send,

§

impl<'a, B> !Sync for RunnerMulti<'a, B>

§

impl<'a, B> Unpin for RunnerMulti<'a, B>

§

impl<'a, B> !UnwindSafe for RunnerMulti<'a, B>

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