Struct TacticalMatch

Source
pub struct TacticalMatch { /* private fields */ }

Implementations§

Source§

impl TacticalMatch

Source

pub fn new( config: Config, roster: Vec<PlayerSetup>, ) -> Result<TacticalMatch, RuleError>

Source

pub fn phase(&self) -> Phase

Source

pub fn remaining(&self) -> f32

Source

pub fn round(&self) -> u32

Source

pub fn score(&self) -> [u16; 2]

Source

pub fn bomb(&self) -> Bomb

Source

pub fn players(&self) -> &[Player]

Source

pub fn player(&self, id: u16) -> Option<&Player>

Source

pub fn interaction_progress(&self) -> Option<(u16, f32)>

Source

pub fn pop_event(&mut self) -> Option<Event>

Source

pub fn set_position( &mut self, id: u16, position: [f32; 3], ) -> Result<(), RuleError>

Integrate movement on the authoritative host, then provide its accepted position. Moving >15 cm from interaction origin interrupts plant/defuse.

Source

pub fn act(&mut self, id: u16, action: Action) -> Result<(), RuleError>

Source

pub fn damage( &mut self, attacker: u16, victim: u16, amount: u16, ) -> Result<(), RuleError>

Apply a server-confirmed hit. Clients must never supply unvalidated hit results.

Source

pub fn tick(&mut self, dt: f32) -> Result<(), RuleError>

Splits elapsed time at every phase/interaction deadline. Large steps produce the same rule transitions as small steps. Bomb expiry wins exact defuse ties.

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