pub struct Project {Show 14 fields
pub name: String,
pub regions: Vec<Region>,
pub tilemaps: Vec<Tilemap>,
pub tiles: IndexMap<Uuid, Tile>,
pub time: TheTime,
pub characters: IndexMap<Uuid, Character>,
pub items: IndexMap<Uuid, Item>,
pub screens: IndexMap<Uuid, Screen>,
pub assets: IndexMap<Uuid, Asset>,
pub palette: ThePalette,
pub target_fps: u32,
pub tick_ms: u32,
pub config: String,
pub avatars: IndexMap<Uuid, Avatar>,
}Fields§
§name: String§regions: Vec<Region>§tilemaps: Vec<Tilemap>§tiles: IndexMap<Uuid, Tile>Tiles in the project
time: TheTime§characters: IndexMap<Uuid, Character>§items: IndexMap<Uuid, Item>§screens: IndexMap<Uuid, Screen>§assets: IndexMap<Uuid, Asset>§palette: ThePalette§target_fps: u32§tick_ms: u32§config: String§avatars: IndexMap<Uuid, Avatar>Implementations§
Source§impl Project
impl Project
pub fn new() -> Project
Sourcepub fn add_character(&mut self, character: Character)
pub fn add_character(&mut self, character: Character)
Add Character
Sourcepub fn remove_character(&mut self, id: &Uuid)
pub fn remove_character(&mut self, id: &Uuid)
Removes the given character from the project.
Sourcepub fn sorted_character_list(&self) -> Vec<(Uuid, String)>
pub fn sorted_character_list(&self) -> Vec<(Uuid, String)>
Returns a list of all characters sorted by name.
Sourcepub fn sorted_item_list(&self) -> Vec<(Uuid, String)>
pub fn sorted_item_list(&self) -> Vec<(Uuid, String)>
Returns a list of all items sorted by name.
Sourcepub fn add_avatar(&mut self, avatar: Avatar)
pub fn add_avatar(&mut self, avatar: Avatar)
Add Avatar
Sourcepub fn remove_avatar(&mut self, id: &Uuid)
pub fn remove_avatar(&mut self, id: &Uuid)
Removes the given avatar from the project.
Sourcepub fn find_avatar_for_animation(&self, animation_id: &Uuid) -> Option<&Avatar>
pub fn find_avatar_for_animation(&self, animation_id: &Uuid) -> Option<&Avatar>
Finds the avatar that contains the given animation id.
Sourcepub fn get_editing_texture(
&self,
editing_ctx: &PixelEditingContext,
) -> Option<&Texture>
pub fn get_editing_texture( &self, editing_ctx: &PixelEditingContext, ) -> Option<&Texture>
Returns an immutable reference to the texture identified by the editing context.
Sourcepub fn get_editing_texture_mut(
&mut self,
editing_ctx: &PixelEditingContext,
) -> Option<&mut Texture>
pub fn get_editing_texture_mut( &mut self, editing_ctx: &PixelEditingContext, ) -> Option<&mut Texture>
Returns a mutable reference to the texture identified by the editing context.
Sourcepub fn get_editing_avatar_frame(
&self,
editing_ctx: &PixelEditingContext,
) -> Option<&AvatarAnimationFrame>
pub fn get_editing_avatar_frame( &self, editing_ctx: &PixelEditingContext, ) -> Option<&AvatarAnimationFrame>
Returns an immutable avatar frame for avatar frame editing contexts.
Sourcepub fn get_editing_avatar_frame_mut(
&mut self,
editing_ctx: &PixelEditingContext,
) -> Option<&mut AvatarAnimationFrame>
pub fn get_editing_avatar_frame_mut( &mut self, editing_ctx: &PixelEditingContext, ) -> Option<&mut AvatarAnimationFrame>
Returns a mutable avatar frame for avatar frame editing contexts.
Sourcepub fn get_editing_avatar_perspective(
&self,
editing_ctx: &PixelEditingContext,
) -> Option<&AvatarPerspective>
pub fn get_editing_avatar_perspective( &self, editing_ctx: &PixelEditingContext, ) -> Option<&AvatarPerspective>
Returns an immutable avatar perspective for avatar frame editing contexts.
Sourcepub fn get_editing_avatar_perspective_mut(
&mut self,
editing_ctx: &PixelEditingContext,
) -> Option<&mut AvatarPerspective>
pub fn get_editing_avatar_perspective_mut( &mut self, editing_ctx: &PixelEditingContext, ) -> Option<&mut AvatarPerspective>
Returns a mutable avatar perspective for avatar frame editing contexts.
Sourcepub fn remove_item(&mut self, id: &Uuid)
pub fn remove_item(&mut self, id: &Uuid)
Removes the given item from the project.
Sourcepub fn add_tilemap(&mut self, tilemap: Tilemap)
pub fn add_tilemap(&mut self, tilemap: Tilemap)
Add a tilemap
Sourcepub fn get_tilemap(&self, uuid: Uuid) -> Option<&Tilemap>
pub fn get_tilemap(&self, uuid: Uuid) -> Option<&Tilemap>
Get the tilemap of the given uuid.
Sourcepub fn get_tilemap_mut(&mut self, uuid: Uuid) -> Option<&mut Tilemap>
pub fn get_tilemap_mut(&mut self, uuid: Uuid) -> Option<&mut Tilemap>
Get the tilemap of the given uuid.
Sourcepub fn remove_tilemap(&mut self, id: TheId)
pub fn remove_tilemap(&mut self, id: TheId)
Removes the given tilemap from the project.
Sourcepub fn contains_region(&self, uuid: &Uuid) -> bool
pub fn contains_region(&self, uuid: &Uuid) -> bool
Contains the region of the given uuid.
Sourcepub fn get_region(&self, uuid: &Uuid) -> Option<&Region>
pub fn get_region(&self, uuid: &Uuid) -> Option<&Region>
Get the region of the given uuid.
Sourcepub fn get_region_mut(&mut self, uuid: &Uuid) -> Option<&mut Region>
pub fn get_region_mut(&mut self, uuid: &Uuid) -> Option<&mut Region>
Get the region of the given uuid as mutable.
Sourcepub fn get_region_ctx(&self, ctx: &ServerContext) -> Option<&Region>
pub fn get_region_ctx(&self, ctx: &ServerContext) -> Option<&Region>
Get the region of the given uuid.
Sourcepub fn get_region_ctx_mut(&mut self, ctx: &ServerContext) -> Option<&mut Region>
pub fn get_region_ctx_mut(&mut self, ctx: &ServerContext) -> Option<&mut Region>
Get the region of the given uuid as mutable.
Sourcepub fn get_screen_ctx(&self, ctx: &ServerContext) -> Option<&Screen>
pub fn get_screen_ctx(&self, ctx: &ServerContext) -> Option<&Screen>
Get the screen of the given uuid.
Sourcepub fn get_screen_ctx_mut(&mut self, ctx: &ServerContext) -> Option<&mut Screen>
pub fn get_screen_ctx_mut(&mut self, ctx: &ServerContext) -> Option<&mut Screen>
Get the mut screen of the given uuid.
Sourcepub fn remove_region(&mut self, id: &Uuid)
pub fn remove_region(&mut self, id: &Uuid)
Remove a region
Sourcepub fn get_map(&self, ctx: &ServerContext) -> Option<&Map>
pub fn get_map(&self, ctx: &ServerContext) -> Option<&Map>
Get the map of the current context.
Sourcepub fn get_map_mut(&mut self, ctx: &ServerContext) -> Option<&mut Map>
pub fn get_map_mut(&mut self, ctx: &ServerContext) -> Option<&mut Map>
Get the mutable map of the current context.
Sourcepub fn add_screen(&mut self, screen: Screen)
pub fn add_screen(&mut self, screen: Screen)
Add Screen
Sourcepub fn remove_screen(&mut self, id: &Uuid)
pub fn remove_screen(&mut self, id: &Uuid)
Removes the given code from the project.
Sourcepub fn sorted_screens_list(&self) -> Vec<(Uuid, String)>
pub fn sorted_screens_list(&self) -> Vec<(Uuid, String)>
Returns a list of all screens sorted by name.
Sourcepub fn remove_asset(&mut self, id: &Uuid)
pub fn remove_asset(&mut self, id: &Uuid)
Removes the given code from the project.
Sourcepub fn sorted_assets_list(&self) -> Vec<(Uuid, String)>
pub fn sorted_assets_list(&self) -> Vec<(Uuid, String)>
Returns a list of all assets sorted by name.
Sourcepub fn remove_tile(&mut self, id: &Uuid)
pub fn remove_tile(&mut self, id: &Uuid)
Removes the given tile from the project.
Sourcepub fn get_tile_mut(&mut self, id: &Uuid) -> Option<&mut Tile>
pub fn get_tile_mut(&mut self, id: &Uuid) -> Option<&mut Tile>
Gets the given mutable tile from the project.
Sourcepub fn extract_tiles(&self) -> IndexMap<Uuid, TheRGBATile>
pub fn extract_tiles(&self) -> IndexMap<Uuid, TheRGBATile>
Extract all tiles from all tilemaps and store them in a hash.
Sourcepub fn extract_tiles_vec(&self) -> Vec<TheRGBATile>
pub fn extract_tiles_vec(&self) -> Vec<TheRGBATile>
Extract all tiles from all tilemaps and store them in a vec.
Sourcepub fn extract_tile(&self, id: &Uuid) -> Option<TheRGBATile>
pub fn extract_tile(&self, id: &Uuid) -> Option<TheRGBATile>
Extract the given tile from the tilemaps.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Project
impl<'de> Deserialize<'de> for Project
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Project, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Project, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Serialize for Project
impl Serialize for Project
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,
Auto Trait Implementations§
impl Freeze for Project
impl RefUnwindSafe for Project
impl Send for Project
impl Sync for Project
impl Unpin for Project
impl UnsafeUnpin for Project
impl UnwindSafe for Project
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> 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>
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>
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)
&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)
&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> 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> 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>
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 moreSource§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().Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§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).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.