pub struct KnowledgeBoardRegistry { /* private fields */ }Expand description
Registry managing all faction knowledge boards (Runtime State)
Implementations§
Source§impl KnowledgeBoardRegistry
impl KnowledgeBoardRegistry
Sourcepub fn register_faction(&mut self, faction_id: FactionId)
pub fn register_faction(&mut self, faction_id: FactionId)
Register a new faction (creates empty knowledge board)
Sourcepub fn get_board(&self, faction_id: &FactionId) -> Option<&KnowledgeBoard>
pub fn get_board(&self, faction_id: &FactionId) -> Option<&KnowledgeBoard>
Get a faction’s knowledge board (immutable)
Sourcepub fn get_board_mut(
&mut self,
faction_id: &FactionId,
) -> Option<&mut KnowledgeBoard>
pub fn get_board_mut( &mut self, faction_id: &FactionId, ) -> Option<&mut KnowledgeBoard>
Get a faction’s knowledge board (mutable)
Sourcepub fn has_faction(&self, faction_id: &FactionId) -> bool
pub fn has_faction(&self, faction_id: &FactionId) -> bool
Check if a faction is registered
Sourcepub fn all_boards(&self) -> impl Iterator<Item = (&FactionId, &KnowledgeBoard)>
pub fn all_boards(&self) -> impl Iterator<Item = (&FactionId, &KnowledgeBoard)>
Get all faction boards (immutable)
Sourcepub fn all_boards_mut(
&mut self,
) -> impl Iterator<Item = (&FactionId, &mut KnowledgeBoard)>
pub fn all_boards_mut( &mut self, ) -> impl Iterator<Item = (&FactionId, &mut KnowledgeBoard)>
Get all faction boards (mutable)
Sourcepub fn faction_count(&self) -> usize
pub fn faction_count(&self) -> usize
Get number of registered factions
Sourcepub fn remove_faction(
&mut self,
faction_id: &FactionId,
) -> Option<KnowledgeBoard>
pub fn remove_faction( &mut self, faction_id: &FactionId, ) -> Option<KnowledgeBoard>
Remove a faction
Trait Implementations§
Source§impl Clone for KnowledgeBoardRegistry
impl Clone for KnowledgeBoardRegistry
Source§fn clone(&self) -> KnowledgeBoardRegistry
fn clone(&self) -> KnowledgeBoardRegistry
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for KnowledgeBoardRegistry
impl Debug for KnowledgeBoardRegistry
Source§impl Default for KnowledgeBoardRegistry
impl Default for KnowledgeBoardRegistry
Source§fn default() -> KnowledgeBoardRegistry
fn default() -> KnowledgeBoardRegistry
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for KnowledgeBoardRegistry
impl<'de> Deserialize<'de> for KnowledgeBoardRegistry
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 KnowledgeBoardRegistry
impl RefUnwindSafe for KnowledgeBoardRegistry
impl Send for KnowledgeBoardRegistry
impl Sync for KnowledgeBoardRegistry
impl Unpin for KnowledgeBoardRegistry
impl UnsafeUnpin for KnowledgeBoardRegistry
impl UnwindSafe for KnowledgeBoardRegistry
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> Component for T
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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> ⓘ
Converts
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> ⓘ
Converts
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