Ifo

Struct Ifo 

Source
pub struct Ifo {
Show 56 fields pub is_save_game: bool, pub is_nwm_file: bool, pub nwm_res_name: String, pub module_id: [u8; 32], pub creator_id: i32, pub version: u32, pub tag: String, pub name: GffLocalizedString, pub description: GffLocalizedString, pub start_movie: ResRef, pub entry_area: ResRef, pub entry_x: f32, pub entry_y: f32, pub entry_z: f32, pub entry_dir_x: f32, pub entry_dir_y: f32, pub min_per_hour: u8, pub dawn_hour: u8, pub dusk_hour: u8, pub xp_scale: u8, pub start_year: u32, pub start_month: u8, pub start_day: u8, pub start_hour: u8, pub start_minute: u16, pub start_second: u16, pub start_millisecond: u16, pub transition: u32, pub pause_time: u32, pub pause_day: u32, pub effect_next_id: u64, pub next_char_id_0: u32, pub next_char_id_1: u32, pub next_obj_id_0: u32, pub next_obj_id_1: u32, pub hak: String, pub on_heartbeat: ResRef, pub on_user_defined: ResRef, pub on_mod_load: ResRef, pub on_mod_start: ResRef, pub on_client_enter: ResRef, pub on_client_leave: ResRef, pub on_activate_item: ResRef, pub on_acquire_item: ResRef, pub on_unacquire_item: ResRef, pub on_player_death: ResRef, pub on_player_dying: ResRef, pub on_spawn_btn_down: ResRef, pub on_player_rest: ResRef, pub on_player_level_up: ResRef, pub on_equip_item: ResRef, pub areas: Vec<IfoArea>, pub expansion_list: Vec<IfoExpansion>, pub cutscene_list: Vec<IfoCutScene>, pub player_list: Vec<IfoPlayer>, pub tokens: Vec<IfoToken>,
}
Expand description

Typed IFO model built from/to Gff data.

Fields§

§is_save_game: bool

Whether this is a save game (Mod_IsSaveGame).

§is_nwm_file: bool

Whether this is an NWM file (Mod_IsNWMFile).

§nwm_res_name: String

NWM resource name, only meaningful when is_nwm_file is true (Mod_NWMResName).

§module_id: [u8; 32]

32-byte module ID blob (Mod_ID).

§creator_id: i32

Creator ID (Mod_Creator_ID).

§version: u32

Module version (Mod_Version).

§tag: String

Module tag (Mod_Tag).

§name: GffLocalizedString

Localized module name (Mod_Name).

§description: GffLocalizedString

Localized module description (Mod_Description).

§start_movie: ResRef

Introductory movie (Mod_StartMovie).

§entry_area: ResRef

Entry area resref (Mod_Entry_Area).

§entry_x: f32

Entry X coordinate (Mod_Entry_X).

§entry_y: f32

Entry Y coordinate (Mod_Entry_Y).

§entry_z: f32

Entry Z coordinate (Mod_Entry_Z).

§entry_dir_x: f32

Entry facing direction X (Mod_Entry_Dir_X).

§entry_dir_y: f32

Entry facing direction Y (Mod_Entry_Dir_Y).

§min_per_hour: u8

Minutes per game hour (Mod_MinPerHour).

§dawn_hour: u8

Dawn hour (Mod_DawnHour).

§dusk_hour: u8

Dusk hour (Mod_DuskHour).

§xp_scale: u8

XP scale multiplier (Mod_XPScale).

§start_year: u32

Game calendar year (Mod_StartYear, save-only, default 1340).

§start_month: u8

Calendar month (Mod_StartMonth, save-only, default 6).

§start_day: u8

Calendar day (Mod_StartDay, save-only, default 1).

§start_hour: u8

Calendar hour (Mod_StartHour, save-only, default 23).

§start_minute: u16

Calendar minute (Mod_StartMinute, save-only, default 0).

§start_second: u16

Calendar second (Mod_StartSecond, save-only, default 0).

§start_millisecond: u16

Calendar millisecond (Mod_StartMiliSec, save-only, default 0).

§transition: u32

Transition state (Mod_Transition, save-only, default 0).

§pause_time: u32

Paused time-of-day in milliseconds (Mod_PauseTime, save-only, default 0).

§pause_day: u32

Paused calendar day (Mod_PauseDay, save-only, default 0).

§effect_next_id: u64

Next effect ID counter (Mod_Effect_NxtId, save-only).

§next_char_id_0: u32

Next character ID low word (Mod_NextCharId0, save-only).

§next_char_id_1: u32

Next character ID high word (Mod_NextCharId1, save-only).

§next_obj_id_0: u32

Next object ID low word (Mod_NextObjId0, save-only).

§next_obj_id_1: u32

Next object ID high word (Mod_NextObjId1, save-only).

§hak: String

Hak pack name (Mod_Hak, save-only).

§on_heartbeat: ResRef

On-heartbeat script (Mod_OnHeartbeat).

§on_user_defined: ResRef

On-user-defined script (Mod_OnUsrDefined).

§on_mod_load: ResRef

On-module-load script (Mod_OnModLoad).

§on_mod_start: ResRef

On-module-start script (Mod_OnModStart).

§on_client_enter: ResRef

On-client-enter script (Mod_OnClientEntr).

§on_client_leave: ResRef

On-client-leave script (Mod_OnClientLeav).

§on_activate_item: ResRef

On-activate-item script (Mod_OnActvtItem).

§on_acquire_item: ResRef

On-acquire-item script (Mod_OnAcquirItem).

§on_unacquire_item: ResRef

On-unacquire-item script (Mod_OnUnAqreItem).

§on_player_death: ResRef

On-player-death script (Mod_OnPlrDeath).

§on_player_dying: ResRef

On-player-dying script (Mod_OnPlrDying).

§on_spawn_btn_down: ResRef

On-spawn-button-down script (Mod_OnSpawnBtnDn).

§on_player_rest: ResRef

On-player-rest script (Mod_OnPlrRest).

§on_player_level_up: ResRef

On-player-level-up script (Mod_OnPlrLvlUp).

§on_equip_item: ResRef

On-equip-item script (Mod_OnEquipItem).

§areas: Vec<IfoArea>

Module areas (Mod_Area_list).

§expansion_list: Vec<IfoExpansion>

Expansion list (Mod_Expan_List).

§cutscene_list: Vec<IfoCutScene>

Cutscene list (Mod_CutSceneList).

§player_list: Vec<IfoPlayer>

Player list (Mod_PlayerList, save-only).

§tokens: Vec<IfoToken>

Token list (Mod_Tokens).

Implementations§

Source§

impl Ifo

Source

pub fn new() -> Self

Creates an empty IFO value.

Source

pub fn from_gff(gff: &Gff) -> Result<Self, IfoError>

Builds typed IFO data from a parsed GFF container.

Source

pub fn to_gff(&self) -> Gff

Converts this typed IFO value into a GFF container.

Builds the GFF root from scratch using only modeled fields.

Trait Implementations§

Source§

impl Clone for Ifo

Source§

fn clone(&self) -> Ifo

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Ifo

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Default for Ifo

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl GffSchema for Ifo

Source§

fn schema() -> &'static [FieldSchema]

Returns the root field schema for this GFF resource type.
Source§

impl PartialEq for Ifo

Source§

fn eq(&self, other: &Ifo) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for Ifo

Auto Trait Implementations§

§

impl Freeze for Ifo

§

impl RefUnwindSafe for Ifo

§

impl Send for Ifo

§

impl Sync for Ifo

§

impl Unpin for Ifo

§

impl UnwindSafe for Ifo

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> Az for T

Source§

fn az<Dst>(self) -> Dst
where T: Cast<Dst>,

Casts the value.
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<Src, Dst> CastFrom<Src> for Dst
where Src: Cast<Dst>,

Source§

fn cast_from(src: Src) -> Dst

Casts the value.
Source§

impl<T> CheckedAs for T

Source§

fn checked_as<Dst>(self) -> Option<Dst>
where T: CheckedCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> CheckedCastFrom<Src> for Dst
where Src: CheckedCast<Dst>,

Source§

fn checked_cast_from(src: Src) -> Option<Dst>

Casts the value.
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> OverflowingAs for T

Source§

fn overflowing_as<Dst>(self) -> (Dst, bool)
where T: OverflowingCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> OverflowingCastFrom<Src> for Dst
where Src: OverflowingCast<Dst>,

Source§

fn overflowing_cast_from(src: Src) -> (Dst, bool)

Casts the value.
Source§

impl<T> SaturatingAs for T

Source§

fn saturating_as<Dst>(self) -> Dst
where T: SaturatingCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> SaturatingCastFrom<Src> for Dst
where Src: SaturatingCast<Dst>,

Source§

fn saturating_cast_from(src: Src) -> Dst

Casts the value.
Source§

impl<T> StrictAs for T

Source§

fn strict_as<Dst>(self) -> Dst
where T: StrictCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> StrictCastFrom<Src> for Dst
where Src: StrictCast<Dst>,

Source§

fn strict_cast_from(src: Src) -> Dst

Casts the value.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.
Source§

impl<T> UnwrappedAs for T

Source§

fn unwrapped_as<Dst>(self) -> Dst
where T: UnwrappedCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> UnwrappedCastFrom<Src> for Dst
where Src: UnwrappedCast<Dst>,

Source§

fn unwrapped_cast_from(src: Src) -> Dst

Casts the value.
Source§

impl<T> WrappingAs for T

Source§

fn wrapping_as<Dst>(self) -> Dst
where T: WrappingCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> WrappingCastFrom<Src> for Dst
where Src: WrappingCast<Dst>,

Source§

fn wrapping_cast_from(src: Src) -> Dst

Casts the value.