pub struct EditorProject {
pub version: u32,
pub schema: Option<Value>,
pub tilesets: Vec<Tileset>,
pub data: Option<Value>,
pub levels: Vec<Level>,
pub autotile_config: Option<Value>,
pub sprite_sheets: Vec<SpriteData>,
pub dialogues: Vec<DialogueTree>,
pub entity_type_configs: HashMap<String, EntityTypeConfig>,
}Expand description
Editor project format - matches what the editor exports
Use this type to load .map.json files created by the editor.
It uses arrays for collections (tilesets, levels, sprite_sheets, dialogues).
Fields§
§version: u32Format version
schema: Option<Value>Schema information (optional, for editor use)
tilesets: Vec<Tileset>Tilesets as array
data: Option<Value>Data section (optional, for editor use)
levels: Vec<Level>Levels as array (editor supports multiple levels)
autotile_config: Option<Value>Autotile configuration (optional)
sprite_sheets: Vec<SpriteData>Sprite sheets as array
dialogues: Vec<DialogueTree>Dialogues as array
entity_type_configs: HashMap<String, EntityTypeConfig>Entity type component configurations (physics, input, sprite per type)
Implementations§
Source§impl EditorProject
impl EditorProject
Sourcepub fn first_level(&self) -> Option<&Level>
pub fn first_level(&self) -> Option<&Level>
Get the first level (most common case)
Sourcepub fn first_sprite_sheet(&self) -> Option<&SpriteData>
pub fn first_sprite_sheet(&self) -> Option<&SpriteData>
Get the first sprite sheet
Sourcepub fn sprite_sheet_by_name(&self, name: &str) -> Option<&SpriteData>
pub fn sprite_sheet_by_name(&self, name: &str) -> Option<&SpriteData>
Get a sprite sheet by name
Sourcepub fn first_dialogue(&self) -> Option<&DialogueTree>
pub fn first_dialogue(&self) -> Option<&DialogueTree>
Get the first dialogue tree
Sourcepub fn dialogue_by_name(&self, name: &str) -> Option<&DialogueTree>
pub fn dialogue_by_name(&self, name: &str) -> Option<&DialogueTree>
Get a dialogue by name
Sourcepub fn tileset_by_id(&self, id: Uuid) -> Option<&Tileset>
pub fn tileset_by_id(&self, id: Uuid) -> Option<&Tileset>
Get a tileset by ID
Sourcepub fn to_map_project(&self) -> Option<MapProject>
pub fn to_map_project(&self) -> Option<MapProject>
Convert to MapProject (uses first level)
Sourcepub fn get_entity_type_config(
&self,
type_name: &str,
) -> Option<&EntityTypeConfig>
pub fn get_entity_type_config( &self, type_name: &str, ) -> Option<&EntityTypeConfig>
Get entity type config by type name
Trait Implementations§
Source§impl Clone for EditorProject
impl Clone for EditorProject
Source§fn clone(&self) -> EditorProject
fn clone(&self) -> EditorProject
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for EditorProject
impl Debug for EditorProject
Source§impl<'de> Deserialize<'de> for EditorProject
impl<'de> Deserialize<'de> for EditorProject
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<EditorProject, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<EditorProject, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for EditorProject
impl Serialize for EditorProject
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl Freeze for EditorProject
impl RefUnwindSafe for EditorProject
impl Send for EditorProject
impl Sync for EditorProject
impl Unpin for EditorProject
impl UnwindSafe for EditorProject
Blanket Implementations§
Source§impl<T, U> AsBindGroupShaderType<U> for T
impl<T, U> AsBindGroupShaderType<U> for T
Source§fn as_bind_group_shader_type(&self, _images: &RenderAssets<GpuImage>) -> U
fn as_bind_group_shader_type(&self, _images: &RenderAssets<GpuImage>) -> U
Return the
T ShaderType for self. When used in AsBindGroup
derives, it is safe to assume that all images in self exist.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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Converts
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Converts
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Converts
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Converts
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
Source§impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
Source§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
Converts
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>
Converts
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 moreSource§impl<T> IntoResult<T> for T
impl<T> IntoResult<T> for T
Source§fn into_result(self) -> Result<T, RunSystemError>
fn into_result(self) -> Result<T, RunSystemError>
Converts this type into the system output type.
Source§impl<T> Serialize for T
impl<T> Serialize for T
fn erased_serialize(&self, serializer: &mut dyn Serializer) -> Result<(), Error>
fn do_erased_serialize( &self, serializer: &mut dyn Serializer, ) -> Result<(), ErrorImpl>
Source§impl<T, U> ToSample<U> for Twhere
U: FromSample<T>,
impl<T, U> ToSample<U> for Twhere
U: FromSample<T>,
fn to_sample_(self) -> U
Source§impl<T> TypeData for T
impl<T> TypeData for T
Source§fn clone_type_data(&self) -> Box<dyn TypeData>
fn clone_type_data(&self) -> Box<dyn TypeData>
Creates a type-erased clone of this value.