Utd

Struct Utd 

Source
pub struct Utd {
Show 63 fields pub template_resref: ResRef, pub tag: String, pub name: GffLocalizedString, pub description: GffLocalizedString, pub comment: String, pub conversation: ResRef, pub faction_id: u32, pub appearance_id: u8, pub unused_appearance_id: u32, pub open_state: u8, pub animation_state: u8, pub auto_remove_key: bool, pub bearing: f32, pub key_name: String, pub key_required: bool, pub lockable: bool, pub locked: bool, pub open_lock_dc: u8, pub close_lock_dc: u8, pub secret_door_dc: u8, pub open_lock_diff: u8, pub open_lock_diff_mod: i8, pub current_hp: i16, pub maximum_hp: i16, pub hardness: u8, pub fortitude: u8, pub reflex: u8, pub will: u8, pub plot: bool, pub invulnerable: bool, pub min1_hp: bool, pub is_static: bool, pub not_blastable: bool, pub interruptable: bool, pub portrait_id: u16, pub palette_id: u8, pub trap_detectable: bool, pub trap_detect_dc: u8, pub trap_disarmable: bool, pub trap_disarm_dc: u8, pub trap_flag: u8, pub trap_one_shot: bool, pub trap_type: u8, pub on_closed: ResRef, pub on_damaged: ResRef, pub on_death: ResRef, pub on_disarm: ResRef, pub on_heartbeat: ResRef, pub on_lock: ResRef, pub on_melee_attacked: ResRef, pub on_open: ResRef, pub on_spell_cast_at: ResRef, pub on_trap_triggered: ResRef, pub on_unlock: ResRef, pub on_user_defined: ResRef, pub on_click: ResRef, pub on_fail_to_open: ResRef, pub on_dialog: ResRef, pub linked_to_flags: u8, pub linked_to: String, pub linked_to_module: ResRef, pub transition_destination: GffLocalizedString, pub loadscreen_id: u16,
}
Expand description

Typed UTD model built from/to Gff data.

Fields§

§template_resref: ResRef

Door template resref (TemplateResRef).

§tag: String

Door tag (Tag).

§name: GffLocalizedString

Localized door name (LocName).

§description: GffLocalizedString

Localized door description (Description).

§comment: String

Toolset comment (Comment).

§conversation: ResRef

Conversation resref (Conversation).

§faction_id: u32

Faction identifier (Faction).

§appearance_id: u8

Generic door type id (GenericType).

§unused_appearance_id: u32

Optional appearance table index (Appearance).

§open_state: u8

Open state (OpenState).

§animation_state: u8

Animation state (AnimationState).

§auto_remove_key: bool

Auto-remove-key flag (AutoRemoveKey).

§bearing: f32

Door bearing in radians (Bearing).

§key_name: String

Key name (KeyName).

§key_required: bool

Key-required flag (KeyRequired).

§lockable: bool

Lockable flag (Lockable).

§locked: bool

Locked flag (Locked).

§open_lock_dc: u8

Open lock DC (OpenLockDC).

§close_lock_dc: u8

Close lock DC (CloseLockDC).

§secret_door_dc: u8

Secret door detect DC (SecretDoorDC).

§open_lock_diff: u8

Open lock difficulty (OpenLockDiff, K2-oriented field).

§open_lock_diff_mod: i8

Open lock difficulty modifier (OpenLockDiffMod, K2-oriented field).

§current_hp: i16

Current hit points (CurrentHP).

§maximum_hp: i16

Maximum hit points (HP).

§hardness: u8

Hardness (Hardness).

§fortitude: u8

Fortitude save (Fort).

§reflex: u8

Reflex save (Ref).

§will: u8

Will save (Will).

§plot: bool

Plot flag (Plot).

§invulnerable: bool

Invulnerable flag (Invulnerable).

§min1_hp: bool

Min-1HP flag (Min1HP).

§is_static: bool

Static flag (Static).

§not_blastable: bool

Not-blastable flag (NotBlastable, K2-oriented field).

§interruptable: bool

Interruptable flag (Interruptable).

§portrait_id: u16

Portrait ID (PortraitId).

§palette_id: u8

Palette ID (PaletteID).

§trap_detectable: bool

Trap-detectable flag (TrapDetectable).

§trap_detect_dc: u8

Trap detect DC (TrapDetectDC).

§trap_disarmable: bool

Trap-disarmable flag (TrapDisarmable).

§trap_disarm_dc: u8

Trap disarm DC (DisarmDC).

§trap_flag: u8

Trap flag (TrapFlag).

§trap_one_shot: bool

Trap one-shot flag (TrapOneShot).

§trap_type: u8

Trap type (TrapType).

§on_closed: ResRef

On-closed script (OnClosed).

§on_damaged: ResRef

On-damaged script (OnDamaged).

§on_death: ResRef

On-death script (OnDeath).

§on_disarm: ResRef

On-disarm script (OnDisarm).

§on_heartbeat: ResRef

On-heartbeat script (OnHeartbeat).

§on_lock: ResRef

On-lock script (OnLock).

§on_melee_attacked: ResRef

On-melee-attacked script (OnMeleeAttacked).

§on_open: ResRef

On-open script (OnOpen).

§on_spell_cast_at: ResRef

On-spell-cast-at script (OnSpellCastAt).

§on_trap_triggered: ResRef

On-trap-triggered script (OnTrapTriggered).

§on_unlock: ResRef

On-unlock script (OnUnlock).

§on_user_defined: ResRef

On-user-defined script (OnUserDefined).

§on_click: ResRef

On-click script (OnClick).

§on_fail_to_open: ResRef

On-open-failed script (OnFailToOpen).

§on_dialog: ResRef

On-dialog script (OnDialog, K2-oriented field).

§linked_to_flags: u8

Linked target flags (LinkedToFlags).

§linked_to: String

Linked target tag (LinkedTo).

§linked_to_module: ResRef

Linked target module (LinkedToModule).

§transition_destination: GffLocalizedString

Localized transition destination (TransitionDestination).

§loadscreen_id: u16

Load screen id (LoadScreenID).

Implementations§

Source§

impl Utd

Source

pub fn new() -> Self

Creates an empty UTD value.

Source

pub fn trap_settings(&self) -> TrapSettings

Returns trap-related settings as a shared typed block.

Source

pub fn set_trap_settings(&mut self, trap: TrapSettings)

Applies trap-related settings from a shared typed block.

Source

pub fn common_trap_scripts(&self) -> CommonTrapScripts

Returns the common trap-script hooks as a shared typed bundle.

Source

pub fn set_common_trap_scripts(&mut self, scripts: CommonTrapScripts)

Applies the common trap-script hooks from a shared typed bundle.

Source

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

Builds typed UTD data from a parsed GFF container.

Source

pub fn to_gff(&self) -> Gff

Converts this typed UTD value into a GFF container.

Trait Implementations§

Source§

impl Clone for Utd

Source§

fn clone(&self) -> Utd

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 Utd

Source§

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

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

impl Default for Utd

Source§

fn default() -> Self

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

impl GffSchema for Utd

Source§

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

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

impl PartialEq for Utd

Source§

fn eq(&self, other: &Utd) -> 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 Utd

Auto Trait Implementations§

§

impl Freeze for Utd

§

impl RefUnwindSafe for Utd

§

impl Send for Utd

§

impl Sync for Utd

§

impl Unpin for Utd

§

impl UnwindSafe for Utd

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.