TagResolver

Struct TagResolver 

Source
pub struct TagResolver { /* private fields */ }
Expand description

Tracks tag progression throughput history

The tag resolver is important to answering questions like “where are they now?” when looking at historic events like province changes or wars. When countries tag switch the tag resolver is able to connect historic events to country’s current selves. For instance in a TYR -> IRE -> GBR game, the provinces and wars gained while playing as TYR should still be aggregated under the current GBR tag.

Implementations§

Source§

impl TagResolver

Source

pub fn create(nation_events: &[NationEvents]) -> Self

Source

pub fn resolve(&self, tag: CountryTag, date: Eu4Date) -> Option<TagData>

Given a date and tag associated with the date, return the current tag where the argument is stored.

Source

pub fn initial(&self, tag: CountryTag) -> Option<TagData>

Return where the country initial’s known as the given tag is now

Source

pub fn at(&self, date: Eu4Date) -> TagResolverDated<'_>

Create a resolver that only considers nation events priot to the given date.

Trait Implementations§

Source§

impl Debug for TagResolver

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.