pub struct AgentId {
pub id: u64,
pub instance_id: u16,
pub master_instance_id: u16,
}
Expand description
Ids for an agent.
Fields§
§id: u64
Agent id as assigned by Arc.
instance_id: u16
Instance id of the agent as appears in game at time of event.
master_instance_id: u16
If agent has a master (e.g. is minion), will be equal to instance id of master, zero otherwise.
Implementations§
source§impl AgentId
impl AgentId
sourcepub const fn new(id: u64, instance_id: u16, master_instance_id: u16) -> Self
pub const fn new(id: u64, instance_id: u16, master_instance_id: u16) -> Self
Creates new agent id information.
sourcepub const fn without_master(id: u64, instance_id: u16) -> Self
pub const fn without_master(id: u64, instance_id: u16) -> Self
Creates new agent id information without a master.
sourcepub const fn from_src(event: &Event) -> Self
pub const fn from_src(event: &Event) -> Self
Creates new agent id information from the Event
source agent.
sourcepub const fn from_dst(event: &Event) -> Self
pub const fn from_dst(event: &Event) -> Self
Creates new agent id information from the Event
destination agent.
sourcepub const fn has_master(&self) -> bool
pub const fn has_master(&self) -> bool
Returns whether the agent has a master.
Trait Implementations§
source§impl<'de> Deserialize<'de> for AgentId
impl<'de> Deserialize<'de> for AgentId
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>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for AgentId
impl RefUnwindSafe for AgentId
impl Send for AgentId
impl Sync for AgentId
impl Unpin for AgentId
impl UnwindSafe for AgentId
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
Mutably borrows from an owned value. Read more