pub struct CharacterWriter<'a, 'b> { /* private fields */ }Expand description
Writes the characters of the factions.
Implementations§
Source§impl CharacterWriter<'_, '_>
impl CharacterWriter<'_, '_>
Sourcepub fn write_family_tree(&self) -> Result<RecordNode>
pub fn write_family_tree(&self) -> Result<RecordNode>
Source§impl<'a, 'b> CharacterWriter<'a, 'b>
impl<'a, 'b> CharacterWriter<'a, 'b>
Sourcepub fn new(
inputs: &'b WorldInputs<'a>,
plan: &WorldPlan<'a>,
forces: &'b ForcePlan<'a>,
posts: &'b PostPlan,
sight: &'b SightPlan,
) -> Result<Self>
pub fn new( inputs: &'b WorldInputs<'a>, plan: &WorldPlan<'a>, forces: &'b ForcePlan<'a>, posts: &'b PostPlan, sight: &'b SightPlan, ) -> Result<Self>
Prepares the writer of the characters.
§Arguments
inputs- Tables, startpos rows and layouts.plan- Order of the factions and regions.forces- Characters and forces of the world.posts- Government posts of the factions.sight- Vision of the world.
§Errors
Returns an error if a table or column is missing.
Sourcepub fn write_character_array(
&self,
faction: &FactionEntry,
) -> Result<RecordNode>
pub fn write_character_array( &self, faction: &FactionEntry, ) -> Result<RecordNode>
Writes the characters of a faction.
§Errors
Returns an error if a table, column or layout is missing.
Sourcepub fn progenitor_family_id(&self, faction: &FactionEntry) -> u32
pub fn progenitor_family_id(&self, faction: &FactionEntry) -> u32
Returns the family member id of a faction’s progenitor (start_pos_characters.progenitor, living or dead), or
0 if it has none.
Sourcepub fn vision(&self, character: &PlannedCharacter<'_>) -> Result<Option<Vision>>
pub fn vision(&self, character: &PlannedCharacter<'_>) -> Result<Option<Vision>>
Returns what a character sees: a disk of its agent’s sight radius around it. Generals without a force don’t see anything.
§Errors
Returns an error if a table or column is missing.
Sourcepub fn characters_of<'s>(
&'s self,
faction: &FactionEntry,
) -> impl Iterator<Item = &'s PlannedCharacter<'a>> + 's
pub fn characters_of<'s>( &'s self, faction: &FactionEntry, ) -> impl Iterator<Item = &'s PlannedCharacter<'a>> + 's
Returns the planned characters of a faction.
Sourcepub fn leader_id(&self, faction: &FactionEntry) -> Option<u32>
pub fn leader_id(&self, faction: &FactionEntry) -> Option<u32>
Returns the runtime id of a faction’s leader, if it has one.
Auto Trait Implementations§
impl<'a, 'b> Freeze for CharacterWriter<'a, 'b>
impl<'a, 'b> RefUnwindSafe for CharacterWriter<'a, 'b>
impl<'a, 'b> Send for CharacterWriter<'a, 'b>
impl<'a, 'b> Sync for CharacterWriter<'a, 'b>
impl<'a, 'b> Unpin for CharacterWriter<'a, 'b>
impl<'a, 'b> UnsafeUnpin for CharacterWriter<'a, 'b>
impl<'a, 'b> UnwindSafe for CharacterWriter<'a, 'b>
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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> ⓘ
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 moreimpl<T> MaybeSend for T
impl<T> MaybeSync for T
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.