pub struct Hero { /* private fields */ }Expand description
A hero record with a non-uniform ability kit.
Implementations§
Source§impl Hero
impl Hero
pub fn new( id: HeroId, name: Fact<LocalizedText>, abilities: Vec<Ability>, evidence: Vec<EvidenceRef>, ) -> Self
pub fn with_role(self, role: Fact<HeroRole>) -> Self
pub fn with_stat(self, key: StatKey, value: Fact<StatValue>) -> Self
pub fn id(&self) -> &HeroId
pub fn name(&self) -> &Fact<LocalizedText>
pub fn role(&self) -> Option<&Fact<HeroRole>>
pub fn stat(&self, key: &StatKey) -> Option<&Fact<StatValue>>
pub fn stats(&self) -> impl Iterator<Item = (&StatKey, &Fact<StatValue>)>
pub fn abilities(&self) -> &[Ability]
pub fn abilities_in_slot(&self, slot: &LogicalSlot) -> Vec<&Ability>
pub fn ability( &self, slot: &LogicalSlot, ) -> Result<&Ability, AbilityLookupError>
pub fn ability_ref( &self, slot: &LogicalSlot, variant: Option<&AbilityVariant>, ) -> Result<&Ability, AbilityLookupError>
pub fn ability_variant( &self, slot: &LogicalSlot, variant: &AbilityVariant, ) -> Result<&Ability, AbilityLookupError>
pub fn evidence(&self) -> &[EvidenceRef]
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Hero
impl<'de> Deserialize<'de> for Hero
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
impl StructuralPartialEq for Hero
Auto Trait Implementations§
impl Freeze for Hero
impl RefUnwindSafe for Hero
impl Send for Hero
impl Sync for Hero
impl Unpin for Hero
impl UnsafeUnpin for Hero
impl UnwindSafe for Hero
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