Struct tiger_lib::Everything

source ·
pub struct Everything { /* private fields */ }
Expand description

A record of everything known about the game and mod being validated.

References to Everything are passed down through nearly all of the validation logic, so that individual functions can access all the defined game items.

The validator has two main phases: parsing and validation.

  • During parsing, the script files are read, parsed, and loaded into the various databases. Everything is mutable during this period.
  • During validation, Everything is immutable and cross-checking between item types can be done safely.

Implementations§

source§

impl Everything

source

pub fn new( config_filepath: Option<&Path>, vanilla_dir: Option<&Path>, mod_root: &Path, replace_paths: Vec<PathBuf> ) -> Result<Self, FilesError>

Create a new Everything instance, ready for validating a mod.

vanilla_dir is the path to the base game files. If it’s None, then no vanilla files will be loaded. This will seriously affect validation, but it’s ok if you just want to load and examine the mod files.

mod_root is the path to the mod files. The config file will also be looked for there.

replace_paths is from the similarly named field in the .mod file.

source

pub fn load_config_filtering_rules(&self)

source

pub fn load_output_settings(&self, default_colors: bool)

source

pub fn load_all(&mut self)

source

pub fn validate_all(&self)

source

pub fn check_rivers(&mut self)

source

pub fn check_pod(&mut self)

source

pub fn check_unused(&mut self)

source

pub fn iter_keys_ck3<'a>( &'a self, itype: Item ) -> Box<dyn Iterator<Item = &Token> + 'a>

source

pub fn iter_keys<'a>( &'a self, itype: Item ) -> Box<dyn Iterator<Item = &Token> + 'a>

Trait Implementations§

source§

impl Debug for Everything

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> AsAny for T
where T: Any,

source§

fn as_any(&self) -> &(dyn Any + 'static)

source§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

source§

fn type_name(&self) -> &'static str

Gets the type name of self
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> Downcast for T
where T: AsAny + ?Sized,

source§

fn is<T>(&self) -> bool
where T: AsAny,

Returns true if the boxed type is the same as T. Read more
source§

fn downcast_ref<T>(&self) -> Option<&T>
where T: AsAny,

Forward to the method defined on the type Any.
source§

fn downcast_mut<T>(&mut self) -> Option<&mut T>
where T: AsAny,

Forward to the method defined on the type Any.
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.

§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

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

§

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>,

§

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.