Move structures to top-level module
This commit is contained in:
parent
930aeb6956
commit
ca6e9cccac
4 changed files with 67 additions and 53 deletions
|
@ -2,7 +2,7 @@ use binrw::{BinRead, BinResult, binrw};
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
common::{read_bool_from, read_string_with_length, write_bool_as, write_string_with_length},
|
common::{read_bool_from, read_string_with_length, write_bool_as, write_string_with_length},
|
||||||
structure::{Struct, guid::Guid},
|
structure::{Guid, Struct},
|
||||||
};
|
};
|
||||||
|
|
||||||
use super::{GenericProperty, PropertyBase};
|
use super::{GenericProperty, PropertyBase};
|
||||||
|
|
|
@ -5,10 +5,7 @@ use crate::{
|
||||||
BoolProperty, IntProperty, NameProperty, StrProperty, array_property::ArrayProperty,
|
BoolProperty, IntProperty, NameProperty, StrProperty, array_property::ArrayProperty,
|
||||||
map_property::MapProperty, set_property::SetProperty,
|
map_property::MapProperty, set_property::SetProperty,
|
||||||
},
|
},
|
||||||
structure::{
|
structure::{DABuildDataStruct, DATuningPointData, TransformStruct},
|
||||||
build_data::DABuildDataStruct, da_tuning_point_data::DATuningPointData,
|
|
||||||
transform::TransformStruct,
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#[paramacro::serialized_struct("Transform")]
|
#[paramacro::serialized_struct("Transform")]
|
||||||
|
|
|
@ -1,9 +1,6 @@
|
||||||
use crate::{
|
use crate::{
|
||||||
property::{BoolProperty, FloatProperty, IntProperty, NameProperty, StrProperty},
|
property::{BoolProperty, FloatProperty, IntProperty, NameProperty, StrProperty},
|
||||||
structure::{
|
structure::{DALoadOptionStruct, DateTimeStruct, SaveSlotInfoStruct},
|
||||||
da_load_option::DALoadOptionStruct, datetime::DateTimeStruct,
|
|
||||||
save_slot_info::SaveSlotInfoStruct,
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#[paramacro::serialized_struct("Transform")]
|
#[paramacro::serialized_struct("Transform")]
|
||||||
|
|
|
@ -1,53 +1,73 @@
|
||||||
use binrw::{BinRead, BinResult, BinWrite, binrw};
|
use binrw::{BinRead, BinResult, BinWrite, binrw};
|
||||||
use build_data::DABuildDataStruct;
|
|
||||||
use da_assemble_id_data::DAAssembleIdDataStruct;
|
|
||||||
use da_customize_asset_id::DACustomizeAssetIdDataStruct;
|
|
||||||
use da_humanoid_coloring_data::DAHumanoidColoringDataStruct;
|
|
||||||
use da_humanoid_figure_data::DAHumanoidFigureData;
|
|
||||||
use da_load_option::DALoadOptionStruct;
|
|
||||||
use da_machine_coloring_data::DAMachineColoringDataStruct;
|
|
||||||
use da_module_color::DAModuleColorStruct;
|
|
||||||
use da_module_item_data::DAModuleItemDataStruct;
|
|
||||||
use da_trigger_data::DATriggerDataStruct;
|
|
||||||
use da_tuning_data::DATuningDataStruct;
|
|
||||||
use da_tuning_point_data::DATuningPointData;
|
|
||||||
use datetime::DateTimeStruct;
|
|
||||||
use guid::Guid;
|
|
||||||
use linear_color::LinearColorStruct;
|
|
||||||
use primary_asset_id::PrimaryAssetIdStruct;
|
|
||||||
use primary_asset_type::PrimaryAssetTypeStruct;
|
|
||||||
use quat::QuatStruct;
|
|
||||||
use save_slot_info::SaveSlotInfoStruct;
|
|
||||||
use std::fmt::Debug;
|
use std::fmt::Debug;
|
||||||
use transform::TransformStruct;
|
|
||||||
use vector::VectorStruct;
|
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
common::{read_string_with_length, write_string_with_length},
|
common::{read_string_with_length, write_string_with_length},
|
||||||
property::PropertyBase,
|
property::PropertyBase,
|
||||||
};
|
};
|
||||||
|
|
||||||
pub mod build_data;
|
mod build_data;
|
||||||
pub mod da_assemble_id_data;
|
pub use self::build_data::DABuildDataStruct;
|
||||||
pub mod da_customize_asset_id;
|
|
||||||
pub mod da_humanoid_coloring_data;
|
mod da_assemble_id_data;
|
||||||
pub mod da_humanoid_figure_data;
|
pub use self::da_assemble_id_data::DAAssembleIdDataStruct;
|
||||||
pub mod da_load_option;
|
|
||||||
pub mod da_machine_coloring_data;
|
mod da_customize_asset_id;
|
||||||
pub mod da_module_color;
|
pub use self::da_customize_asset_id::DACustomizeAssetIdDataStruct;
|
||||||
pub mod da_module_item_data;
|
|
||||||
pub mod da_trigger_data;
|
mod da_humanoid_coloring_data;
|
||||||
pub mod da_tuning_data;
|
pub use self::da_humanoid_coloring_data::DAHumanoidColoringDataStruct;
|
||||||
pub mod da_tuning_point_data;
|
|
||||||
pub mod datetime;
|
mod da_humanoid_figure_data;
|
||||||
pub mod guid;
|
pub use self::da_humanoid_figure_data::DAHumanoidFigureData;
|
||||||
pub mod linear_color;
|
|
||||||
pub mod primary_asset_id;
|
mod da_load_option;
|
||||||
pub mod primary_asset_type;
|
pub use self::da_load_option::DALoadOptionStruct;
|
||||||
pub mod quat;
|
|
||||||
pub mod save_slot_info;
|
mod da_machine_coloring_data;
|
||||||
pub mod transform;
|
pub use self::da_machine_coloring_data::DAMachineColoringDataStruct;
|
||||||
pub mod vector;
|
|
||||||
|
mod da_module_color;
|
||||||
|
pub use self::da_module_color::DAModuleColorStruct;
|
||||||
|
|
||||||
|
mod da_module_item_data;
|
||||||
|
pub use self::da_module_item_data::DAModuleItemDataStruct;
|
||||||
|
|
||||||
|
mod da_trigger_data;
|
||||||
|
pub use self::da_trigger_data::DATriggerDataStruct;
|
||||||
|
|
||||||
|
mod da_tuning_data;
|
||||||
|
pub use self::da_tuning_data::DATuningDataStruct;
|
||||||
|
|
||||||
|
mod da_tuning_point_data;
|
||||||
|
pub use self::da_tuning_point_data::DATuningPointData;
|
||||||
|
|
||||||
|
mod datetime;
|
||||||
|
pub use self::datetime::DateTimeStruct;
|
||||||
|
|
||||||
|
mod guid;
|
||||||
|
pub use self::guid::Guid;
|
||||||
|
|
||||||
|
mod linear_color;
|
||||||
|
pub use self::linear_color::LinearColorStruct;
|
||||||
|
|
||||||
|
mod primary_asset_id;
|
||||||
|
pub use self::primary_asset_id::PrimaryAssetIdStruct;
|
||||||
|
|
||||||
|
mod primary_asset_type;
|
||||||
|
pub use self::primary_asset_type::PrimaryAssetTypeStruct;
|
||||||
|
|
||||||
|
mod quat;
|
||||||
|
pub use self::quat::QuatStruct;
|
||||||
|
|
||||||
|
mod save_slot_info;
|
||||||
|
pub use self::save_slot_info::SaveSlotInfoStruct;
|
||||||
|
|
||||||
|
mod transform;
|
||||||
|
pub use self::transform::TransformStruct;
|
||||||
|
|
||||||
|
mod vector;
|
||||||
|
pub use self::vector::VectorStruct;
|
||||||
|
|
||||||
#[binrw]
|
#[binrw]
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
|
@ -140,7 +160,7 @@ pub(crate) fn calc_size_in_bytes(r#struct: &Struct) -> u32 {
|
||||||
|
|
||||||
#[binrw]
|
#[binrw]
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct StructFieldPrelude {
|
pub(crate) struct StructFieldPrelude {
|
||||||
#[br(parse_with = read_string_with_length)]
|
#[br(parse_with = read_string_with_length)]
|
||||||
#[bw(write_with = write_string_with_length)]
|
#[bw(write_with = write_string_with_length)]
|
||||||
pub property_name: String,
|
pub property_name: String,
|
||||||
|
@ -152,7 +172,7 @@ pub struct StructFieldPrelude {
|
||||||
|
|
||||||
#[binrw]
|
#[binrw]
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct StructPrelude {
|
pub(crate) struct StructPrelude {
|
||||||
pub size_in_bytes: u32,
|
pub size_in_bytes: u32,
|
||||||
#[brw(pad_before = 4)]
|
#[brw(pad_before = 4)]
|
||||||
#[br(parse_with = read_string_with_length)]
|
#[br(parse_with = read_string_with_length)]
|
||||||
|
|
Loading…
Add table
Reference in a new issue