pub struct AnimFragmentBattle { /* private fields */ }Expand description
Represents a battle animation fragment file.
Contains animation entries and metadata for a specific skeleton type. The structure varies by game version, with newer games supporting more features.
§Version Differences
- Version 2 (Warhammer 2/Troy/Pharaoh): Basic structure with min/max IDs
- Version 2 (Three Kingdoms): Adds mount tables and locomotion graph support
- Version 4 (Warhammer 3): Enhanced with subversion and cavalry tech flags
Implementations§
Source§impl AnimFragmentBattle
impl AnimFragmentBattle
Sourcepub fn skeleton_name(&self) -> &String
pub fn skeleton_name(&self) -> &String
Name of the skeleton this animation fragment applies to.
Sourcepub fn subversion(&self) -> &u32
pub fn subversion(&self) -> &u32
Format subversion (version 4 only).
Sourcepub fn table_name(&self) -> &String
pub fn table_name(&self) -> &String
Name of the animation table.
Sourcepub fn mount_table_name(&self) -> &String
pub fn mount_table_name(&self) -> &String
Name of the mount animation table.
Sourcepub fn unmount_table_name(&self) -> &String
pub fn unmount_table_name(&self) -> &String
Name of the unmount animation table.
Sourcepub fn locomotion_graph(&self) -> &String
pub fn locomotion_graph(&self) -> &String
Locomotion graph identifier.
Sourcepub fn is_simple_flight(&self) -> &bool
pub fn is_simple_flight(&self) -> &bool
Whether this uses simple flight mechanics.
Sourcepub fn is_new_cavalry_tech(&self) -> &bool
pub fn is_new_cavalry_tech(&self) -> &bool
Whether this uses new cavalry technology.
Source§impl AnimFragmentBattle
impl AnimFragmentBattle
Sourcepub fn version_mut(&mut self) -> &mut u32
pub fn version_mut(&mut self) -> &mut u32
File format version (2 or 4).
Sourcepub fn entries_mut(&mut self) -> &mut Vec<Entry>
pub fn entries_mut(&mut self) -> &mut Vec<Entry>
List of animation entries in this fragment.
Sourcepub fn skeleton_name_mut(&mut self) -> &mut String
pub fn skeleton_name_mut(&mut self) -> &mut String
Name of the skeleton this animation fragment applies to.
Sourcepub fn subversion_mut(&mut self) -> &mut u32
pub fn subversion_mut(&mut self) -> &mut u32
Format subversion (version 4 only).
Sourcepub fn table_name_mut(&mut self) -> &mut String
pub fn table_name_mut(&mut self) -> &mut String
Name of the animation table.
Sourcepub fn mount_table_name_mut(&mut self) -> &mut String
pub fn mount_table_name_mut(&mut self) -> &mut String
Name of the mount animation table.
Sourcepub fn unmount_table_name_mut(&mut self) -> &mut String
pub fn unmount_table_name_mut(&mut self) -> &mut String
Name of the unmount animation table.
Sourcepub fn locomotion_graph_mut(&mut self) -> &mut String
pub fn locomotion_graph_mut(&mut self) -> &mut String
Locomotion graph identifier.
Sourcepub fn is_simple_flight_mut(&mut self) -> &mut bool
pub fn is_simple_flight_mut(&mut self) -> &mut bool
Whether this uses simple flight mechanics.
Sourcepub fn is_new_cavalry_tech_mut(&mut self) -> &mut bool
pub fn is_new_cavalry_tech_mut(&mut self) -> &mut bool
Whether this uses new cavalry technology.
Sourcepub fn min_id_mut(&mut self) -> &mut u32
pub fn min_id_mut(&mut self) -> &mut u32
Minimum animation ID in this fragment (version 2 only).
Sourcepub fn max_id_mut(&mut self) -> &mut u32
pub fn max_id_mut(&mut self) -> &mut u32
Maximum animation ID in this fragment (version 2 only).
Source§impl AnimFragmentBattle
impl AnimFragmentBattle
Sourcepub fn set_version(&mut self, val: u32) -> &mut Self
pub fn set_version(&mut self, val: u32) -> &mut Self
File format version (2 or 4).
Sourcepub fn set_entries(&mut self, val: Vec<Entry>) -> &mut Self
pub fn set_entries(&mut self, val: Vec<Entry>) -> &mut Self
List of animation entries in this fragment.
Sourcepub fn set_skeleton_name(&mut self, val: String) -> &mut Self
pub fn set_skeleton_name(&mut self, val: String) -> &mut Self
Name of the skeleton this animation fragment applies to.
Sourcepub fn set_subversion(&mut self, val: u32) -> &mut Self
pub fn set_subversion(&mut self, val: u32) -> &mut Self
Format subversion (version 4 only).
Sourcepub fn set_table_name(&mut self, val: String) -> &mut Self
pub fn set_table_name(&mut self, val: String) -> &mut Self
Name of the animation table.
Sourcepub fn set_mount_table_name(&mut self, val: String) -> &mut Self
pub fn set_mount_table_name(&mut self, val: String) -> &mut Self
Name of the mount animation table.
Sourcepub fn set_unmount_table_name(&mut self, val: String) -> &mut Self
pub fn set_unmount_table_name(&mut self, val: String) -> &mut Self
Name of the unmount animation table.
Sourcepub fn set_locomotion_graph(&mut self, val: String) -> &mut Self
pub fn set_locomotion_graph(&mut self, val: String) -> &mut Self
Locomotion graph identifier.
Sourcepub fn set_is_simple_flight(&mut self, val: bool) -> &mut Self
pub fn set_is_simple_flight(&mut self, val: bool) -> &mut Self
Whether this uses simple flight mechanics.
Sourcepub fn set_is_new_cavalry_tech(&mut self, val: bool) -> &mut Self
pub fn set_is_new_cavalry_tech(&mut self, val: bool) -> &mut Self
Whether this uses new cavalry technology.
Sourcepub fn set_min_id(&mut self, val: u32) -> &mut Self
pub fn set_min_id(&mut self, val: u32) -> &mut Self
Minimum animation ID in this fragment (version 2 only).
Sourcepub fn set_max_id(&mut self, val: u32) -> &mut Self
pub fn set_max_id(&mut self, val: u32) -> &mut Self
Maximum animation ID in this fragment (version 2 only).
Source§impl AnimFragmentBattle
impl AnimFragmentBattle
Sourcepub fn definitions() -> (Definition, Definition)
pub fn definitions() -> (Definition, Definition)
Returns table schema definitions for animation fragments.
Provides two Definitions:
- Main entry definition with all animation entry fields
- Animation reference sub-definition (for version 4
anim_refsfield)
These definitions are used when converting animation fragments to/from
TableInMemory for TSV export/import.
§Returns
A tuple of (entry_definition, anim_ref_definition).
Sourcepub fn from_table(table: &TableInMemory) -> Result<Vec<Entry>>
pub fn from_table(table: &TableInMemory) -> Result<Vec<Entry>>
Converts a table to a list of animation entries.
Parses a TableInMemory (typically loaded from TSV)
and extracts animation entry data.
§Parameters
table: The table containing animation entry data
§Returns
A vector of Entry structs parsed from the table rows.
§Errors
Returns an error if the table structure doesn’t match the expected schema or if data conversion fails.
Sourcepub fn to_table(&self) -> Result<TableInMemory>
pub fn to_table(&self) -> Result<TableInMemory>
Converts this animation fragment to a table.
Creates a TableInMemory from the animation entries, which can then be
exported as TSV for editing.
§Returns
A table containing all animation entries with the appropriate schema.
§Errors
Returns an error if table construction or data conversion fails.
Trait Implementations§
Source§impl Clone for AnimFragmentBattle
impl Clone for AnimFragmentBattle
Source§fn clone(&self) -> AnimFragmentBattle
fn clone(&self) -> AnimFragmentBattle
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for AnimFragmentBattle
impl Debug for AnimFragmentBattle
Source§impl Decodeable for AnimFragmentBattle
impl Decodeable for AnimFragmentBattle
Source§impl Default for AnimFragmentBattle
impl Default for AnimFragmentBattle
Source§fn default() -> AnimFragmentBattle
fn default() -> AnimFragmentBattle
Source§impl<'de> Deserialize<'de> for AnimFragmentBattle
impl<'de> Deserialize<'de> for AnimFragmentBattle
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Encodeable for AnimFragmentBattle
impl Encodeable for AnimFragmentBattle
Source§fn encode<W: WriteBytes>(
&mut self,
buffer: &mut W,
extra_data: &Option<EncodeableExtraData<'_>>,
) -> Result<()>
fn encode<W: WriteBytes>( &mut self, buffer: &mut W, extra_data: &Option<EncodeableExtraData<'_>>, ) -> Result<()>
Source§impl PartialEq for AnimFragmentBattle
impl PartialEq for AnimFragmentBattle
Source§impl Serialize for AnimFragmentBattle
impl Serialize for AnimFragmentBattle
impl StructuralPartialEq for AnimFragmentBattle
Auto Trait Implementations§
impl Freeze for AnimFragmentBattle
impl RefUnwindSafe for AnimFragmentBattle
impl Send for AnimFragmentBattle
impl Sync for AnimFragmentBattle
impl Unpin for AnimFragmentBattle
impl UnsafeUnpin for AnimFragmentBattle
impl UnwindSafe for AnimFragmentBattle
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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>
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 more§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().§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>
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
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
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.