pub struct Character {Show 29 fields
name: Rc<str>,
nick: Option<Rc<str>>,
birth: Date,
dead: bool,
date: Option<Date>,
reason: Option<Rc<str>>,
faith: Option<Shared<GameObjectEntity<Faith>>>,
culture: Option<Shared<GameObjectEntity<Culture>>>,
house: Option<Shared<GameObjectEntity<House>>>,
skills: Vec<i8>,
traits: Vec<Rc<str>>,
spouses: HashSet<Shared<GameObjectEntity<Character>>>,
former: Vec<Shared<GameObjectEntity<Character>>>,
children: Vec<Shared<GameObjectEntity<Character>>>,
parents: Vec<Shared<GameObjectEntity<Character>>>,
dna: Option<Rc<str>>,
memories: Vec<Shared<GameObjectEntity<Memory>>>,
titles: Vec<Shared<GameObjectEntity<Title>>>,
gold: f32,
piety: f32,
prestige: f32,
dread: f32,
strength: f32,
kills: Vec<Shared<GameObjectEntity<Character>>>,
languages: Vec<Rc<str>>,
vassals: Vec<Vassal>,
liege: Option<Shared<GameObjectEntity<Character>>>,
female: bool,
artifacts: Vec<Shared<GameObjectEntity<Artifact>>>,
}
Expand description
Represents a character in the game.
Fields§
§name: Rc<str>
§nick: Option<Rc<str>>
§birth: Date
§dead: bool
§date: Option<Date>
§reason: Option<Rc<str>>
§faith: Option<Shared<GameObjectEntity<Faith>>>
§culture: Option<Shared<GameObjectEntity<Culture>>>
§house: Option<Shared<GameObjectEntity<House>>>
§skills: Vec<i8>
§traits: Vec<Rc<str>>
§spouses: HashSet<Shared<GameObjectEntity<Character>>>
§former: Vec<Shared<GameObjectEntity<Character>>>
§children: Vec<Shared<GameObjectEntity<Character>>>
§parents: Vec<Shared<GameObjectEntity<Character>>>
§dna: Option<Rc<str>>
§memories: Vec<Shared<GameObjectEntity<Memory>>>
§titles: Vec<Shared<GameObjectEntity<Title>>>
§gold: f32
§piety: f32
§prestige: f32
§dread: f32
§strength: f32
§kills: Vec<Shared<GameObjectEntity<Character>>>
§languages: Vec<Rc<str>>
§vassals: Vec<Vassal>
§liege: Option<Shared<GameObjectEntity<Character>>>
§female: bool
§artifacts: Vec<Shared<GameObjectEntity<Artifact>>>
Implementations§
Source§impl Character
impl Character
Sourcepub fn get_female(&self) -> bool
pub fn get_female(&self) -> bool
Gets whether the character is female
pub fn get_faith(&self) -> Option<Shared<GameObjectEntity<Faith>>>
pub fn get_culture(&self) -> Option<Shared<GameObjectEntity<Culture>>>
Sourcepub fn register_parent(&mut self, parent: Shared<GameObjectEntity<Character>>)
pub fn register_parent(&mut self, parent: Shared<GameObjectEntity<Character>>)
Adds a character as a parent of this character
Sourcepub fn get_death_date(&self) -> Option<Date>
pub fn get_death_date(&self) -> Option<Date>
Gets the death date string of the character
Sourcepub fn add_vassal(&mut self, vassal: Shared<GameObjectEntity<Character>>)
pub fn add_vassal(&mut self, vassal: Shared<GameObjectEntity<Character>>)
Adds a character as a vassal of this character
pub fn set_liege(&mut self, liege: Shared<GameObjectEntity<Character>>)
Sourcepub fn get_barony_keys(&self, de_jure: bool) -> Vec<Rc<str>>
pub fn get_barony_keys(&self, de_jure: bool) -> Vec<Rc<str>>
Gets all of the held de jure barony keys of the character and their vassals
Sourcepub fn get_descendants(&self) -> Vec<Shared<GameObjectEntity<Character>>>
pub fn get_descendants(&self) -> Vec<Shared<GameObjectEntity<Character>>>
Gets the descendants of the character
Trait Implementations§
Source§impl FromGameObject for Character
impl FromGameObject for Character
fn from_game_object( base: &HashMap<String, SaveFileValue>, game_state: &mut GameState, ) -> Result<Self, ParsingError>
fn finalize(&mut self, reference: &Shared<GameObjectEntity<Character>>)
Source§impl GameObjectDerived for Character
impl GameObjectDerived for Character
Source§impl Localizable for Character
impl Localizable for Character
Source§impl ProceduralPath for Character
impl ProceduralPath for Character
fn get_subdir() -> &'static str
Source§fn get_children(&self) -> Option<Vec<Shared<GameObjectEntity<Character>>>>
fn get_children(&self) -> Option<Vec<Shared<GameObjectEntity<Character>>>>
Returns an iterator over the children of the node
Source§fn get_parent(&self) -> Option<Vec<Shared<GameObjectEntity<Character>>>>
fn get_parent(&self) -> Option<Vec<Shared<GameObjectEntity<Character>>>>
Returns an iterator over the parent of the node
Auto Trait Implementations§
impl Freeze for Character
impl !RefUnwindSafe for Character
impl !Send for Character
impl !Sync for Character
impl Unpin for Character
impl !UnwindSafe for Character
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,
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