Struct ldtk_rust::Definitions
source · [−]pub struct Definitions {
pub entities: Vec<EntityDefinition>,
pub enums: Vec<EnumDefinition>,
pub external_enums: Vec<EnumDefinition>,
pub layers: Vec<LayerDefinition>,
pub level_fields: Vec<FieldDefinition>,
pub tilesets: Vec<TilesetDefinition>,
}
Expand description
If you’re writing your own LDtk importer, you should probably just ignore most stuff in
the defs
section, as it contains data that are mostly important to the editor. To keep
you away from the defs
section and avoid some unnecessary JSON parsing, important data
from definitions is often duplicated in fields prefixed with a double underscore (eg.
__identifier
or __type
). The 2 only definition types you might need here are
Tilesets and Enums.
A structure containing all the definitions of this project
Fields
entities: Vec<EntityDefinition>
All entities definitions, including their custom fields
enums: Vec<EnumDefinition>
All internal enums
external_enums: Vec<EnumDefinition>
Note: external enums are exactly the same as enums
, except they have a relPath
to
point to an external source file.
layers: Vec<LayerDefinition>
All layer definitions
level_fields: Vec<FieldDefinition>
All custom fields available to all levels.
tilesets: Vec<TilesetDefinition>
All tilesets
Trait Implementations
sourceimpl<'de> Deserialize<'de> for Definitions
impl<'de> Deserialize<'de> for Definitions
sourcefn 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>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl Serialize for Definitions
impl Serialize for Definitions
Auto Trait Implementations
impl RefUnwindSafe for Definitions
impl Send for Definitions
impl Sync for Definitions
impl Unpin for Definitions
impl UnwindSafe for Definitions
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more