pub struct SC2ReplayState {
pub init_data: InitData,
pub details: Details,
pub units: HashMap<u32, SC2Unit>,
pub user_state: HashMap<i64, SC2UserState>,
pub balance_units: VersionedBalanceUnits,
}Expand description
The state of the replay as it’s being processed, units are added to owners, control groups are updated, unit position recorded, etc.
Fields§
§init_data: InitDataThe parsed replay.initData from the MPQ, used to get further information about the players, protocol version, map size, observe, user_id (can be used to match between different event typse)
details: DetailsThe parsed replay.details from the MPQ, used to get information on the players
units: HashMap<u32, SC2Unit>The registered units state as they change through time. These are with unit index as reference
user_state: HashMap<i64, SC2UserState>The per-user state, the control groups, the supply, units, upgrades, as it progresses through time.
balance_units: VersionedBalanceUnitsThe current protocol version abilities, containing a possible string translation.
Implementations§
Source§impl SC2ReplayState
impl SC2ReplayState
pub fn with_balance_units( self, balance_units: HashMap<String, VersionedBalanceUnit>, ) -> Self
Sourcepub fn handle_transition_to_next_event(
&mut self,
event: SC2EventType,
) -> SC2EventIteratorItem
pub fn handle_transition_to_next_event( &mut self, event: SC2EventType, ) -> SC2EventIteratorItem
When an event is meant to be consumed (i.e. it’s the next in order), then the state of the game needs to transition through the event, returning a Hint of what has changed.
Trait Implementations§
Source§impl Clone for SC2ReplayState
impl Clone for SC2ReplayState
Source§fn clone(&self) -> SC2ReplayState
fn clone(&self) -> SC2ReplayState
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SC2ReplayState
impl Debug for SC2ReplayState
Source§impl Default for SC2ReplayState
impl Default for SC2ReplayState
Source§fn default() -> SC2ReplayState
fn default() -> SC2ReplayState
Source§impl<'de> Deserialize<'de> for SC2ReplayState
impl<'de> Deserialize<'de> for SC2ReplayState
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Serialize for SC2ReplayState
impl Serialize for SC2ReplayState
Auto Trait Implementations§
impl Freeze for SC2ReplayState
impl RefUnwindSafe for SC2ReplayState
impl Send for SC2ReplayState
impl Sync for SC2ReplayState
impl Unpin for SC2ReplayState
impl UnwindSafe for SC2ReplayState
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more