pub struct CaiContext { /* private fields */ }Expand description
What the AI writer works out of a campaign before writing.
Implementations§
Source§impl CaiContext
impl CaiContext
Sourcepub fn write_interface(&self, inputs: &CaiInputs<'_>) -> Result<RecordNode>
pub fn write_interface(&self, inputs: &CaiInputs<'_>) -> Result<RecordNode>
Sourcepub fn write_campaign_director(
&self,
layout: &StartposLayout,
) -> Result<RecordNode>
pub fn write_campaign_director( &self, layout: &StartposLayout, ) -> Result<RecordNode>
Source§impl CaiContext
impl CaiContext
Sourcepub fn map_regions(&self) -> &Vec<MapRegion>
pub fn map_regions(&self) -> &Vec<MapRegion>
Regions of the map, in map order.
Sourcepub fn region_map(&self) -> &RegionMap
pub fn region_map(&self) -> &RegionMap
Region and area of each cell.
Sourcepub fn settlement_layouts(&self) -> &Vec<SettlementLayout>
pub fn settlement_layouts(&self) -> &Vec<SettlementLayout>
Settlement layouts of the map.
Sourcepub fn technologies(&self) -> &Vec<Vec<String>>
pub fn technologies(&self) -> &Vec<Vec<String>>
Technology keys of each world faction’s tree.
Sourcepub fn theatre_key(&self) -> &String
pub fn theatre_key(&self) -> &String
Key of the map’s theatre.
Source§impl CaiContext
impl CaiContext
Sourcepub fn new(inputs: &CaiInputs<'_>) -> Result<Self>
pub fn new(inputs: &CaiInputs<'_>) -> Result<Self>
Works out what the AI writer needs from a campaign.
§Errors
Returns an error if the world doesn’t fit its layouts, a map file is malformed or a table is missing.
Sourcepub fn write_world(&self, inputs: &CaiInputs<'_>) -> Result<RecordNode>
pub fn write_world(&self, inputs: &CaiInputs<'_>) -> Result<RecordNode>
Writes the world mirror (CAI_WORLD).
§Errors
Returns an error if a table is missing or the layout lacks a record.
Trait Implementations§
Source§impl Clone for CaiContext
impl Clone for CaiContext
Source§fn clone(&self) -> CaiContext
fn clone(&self) -> CaiContext
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 moreAuto Trait Implementations§
impl Freeze for CaiContext
impl RefUnwindSafe for CaiContext
impl Send for CaiContext
impl Sync for CaiContext
impl Unpin for CaiContext
impl UnsafeUnpin for CaiContext
impl UnwindSafe for CaiContext
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§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.