pub struct Project {Show 28 fields
pub name: String,
pub regions: Vec<Region>,
pub tilemaps: Vec<Tilemap>,
pub tiles: IndexMap<Uuid, Tile>,
pub tile_groups: IndexMap<Uuid, TileGroup>,
pub tile_node_groups: IndexMap<Uuid, NodeGroupAsset>,
pub builder_graphs: IndexMap<Uuid, BuilderGraphAsset>,
pub tile_collections: IndexMap<Uuid, TileCollectionAsset>,
pub tile_board_tiles: IndexMap<Uuid, Vec2<i32>>,
pub tile_board_groups: IndexMap<Uuid, Vec2<i32>>,
pub tile_board_empty_slots: Vec<Vec2<i32>>,
pub tile_board_cols: i32,
pub tile_board_rows: i32,
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 rules: String,
pub locales: String,
pub audio_fx: String,
pub authoring: String,
pub avatars: IndexMap<Uuid, Avatar>,
pub palette_materials: Vec<PaletteMaterial>,
}Fields§
§name: String§regions: Vec<Region>§tilemaps: Vec<Tilemap>§tiles: IndexMap<Uuid, Tile>Tiles in the project
tile_groups: IndexMap<Uuid, TileGroup>Spatial tile groups in the project.
tile_node_groups: IndexMap<Uuid, NodeGroupAsset>Node-backed tile groups keyed by tile-group id.
builder_graphs: IndexMap<Uuid, BuilderGraphAsset>Standalone builder graphs for props and assemblies.
tile_collections: IndexMap<Uuid, TileCollectionAsset>Custom top-level tile collections shown as tabs in the tile picker.
tile_board_tiles: IndexMap<Uuid, Vec2<i32>>Persisted board positions for top-level single tiles in the tile picker.
tile_board_groups: IndexMap<Uuid, Vec2<i32>>Persisted board positions for top-level tile groups in the tile picker.
tile_board_empty_slots: Vec<Vec2<i32>>Persisted empty board cells left behind by deletions in the tile picker.
tile_board_cols: i32Total board width in cells, including the trailing empty strip.
tile_board_rows: i32Total board height in cells, including the trailing empty strip.
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§rules: String§locales: String§audio_fx: String§avatars: IndexMap<Uuid, Avatar>§palette_materials: Vec<PaletteMaterial>Implementations§
Source§impl Project
impl Project
pub fn new() -> Self
Sourcepub fn add_character(&mut self, character: Character)
pub fn add_character(&mut self, character: Character)
Add Character
pub fn ensure_palette_materials_len(&mut self)
pub fn reset_palette_material(&mut self, index: usize)
pub fn reset_all_palette_materials(&mut self)
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
pub fn add_tile_group(&mut self, tile_group: TileGroup)
pub fn add_tile_node_group(&mut self, node_group: NodeGroupAsset)
pub fn add_builder_graph(&mut self, builder_graph: BuilderGraphAsset)
pub fn add_tile_collection(&mut self, collection: TileCollectionAsset)
pub fn is_tile_node_group(&self, id: &Uuid) -> bool
pub fn collection_contains_source( &self, collection_id: &Uuid, source: TileSource, ) -> bool
pub fn add_source_to_collection( &mut self, collection_id: &Uuid, source: TileSource, )
pub fn remove_source_from_collections(&mut self, source: TileSource)
pub fn remove_tile_group(&mut self, id: &Uuid)
pub fn tile_board_position(&self, source: TileSource) -> Option<Vec2<i32>>
pub fn collection_tile_board_position( &self, collection_id: &Uuid, source: TileSource, ) -> Option<Vec2<i32>>
pub fn tile_board_empty_slots(&self) -> &[Vec2<i32>]
pub fn collection_tile_board_empty_slots( &self, collection_id: &Uuid, ) -> Option<&[Vec2<i32>]>
pub fn set_tile_board_position(&mut self, source: TileSource, pos: Vec2<i32>)
pub fn set_collection_tile_board_position( &mut self, collection_id: &Uuid, source: TileSource, pos: Vec2<i32>, )
pub fn reserve_tile_board_empty_slot(&mut self, pos: Vec2<i32>)
pub fn reserve_collection_tile_board_empty_slot( &mut self, collection_id: &Uuid, pos: Vec2<i32>, )
pub fn clear_tile_board_empty_slot(&mut self, pos: Vec2<i32>)
pub fn ensure_tile_board_space(&mut self, pos: Vec2<i32>)
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<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
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> 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.