diff options
author | 2024-12-24 00:54:31 -0500 | |
---|---|---|
committer | 2024-12-24 00:54:31 -0500 | |
commit | a1e9304dc31980703446bdb33246e314bafd3b15 (patch) | |
tree | 47c9dd32398a6d84050f39fac17d52d0a5d9ad4e /src/resources.rs | |
parent | f3a7c2139cb3f9074d28dd99fa1bbd10d752547e (diff) |
Switched to bevy_mod_scripting, bevy 0.15 updatev0.4.0
Diffstat (limited to 'src/resources.rs')
-rw-r--r-- | src/resources.rs | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/resources.rs b/src/resources.rs index cbf570d..bf0c072 100644 --- a/src/resources.rs +++ b/src/resources.rs @@ -1,9 +1,8 @@ -use std::{collections::{BTreeMap, HashMap}, path::PathBuf}; +use std::{collections::BTreeMap, path::PathBuf}; use bevy::{ecs::world::CommandQueue, prelude::*, tasks::Task}; use multi_key_map::MultiKeyMap; use occule::Codec; -use uuid::Uuid; use crate::payload::DirworldEntityPayload; @@ -14,7 +13,9 @@ pub struct DirworldRootDir(pub Option<PathBuf>); /// Current directory of the world #[derive(Resource, Default)] pub struct DirworldCurrentDir{ + /// Path of current directory pub path: PathBuf, + /// Payload (contents of .door file) in current directory, if present pub payload: Option<DirworldEntityPayload>, } @@ -22,18 +23,20 @@ pub struct DirworldCurrentDir{ #[derive(Default, Resource, Deref, DerefMut)] pub struct DirworldTasks(pub BTreeMap<String, Task<Option<CommandQueue>>>); +/// A map between file types and their corresponding preload/spawn callback observers #[derive(Debug, Default, Resource, Deref, DerefMut)] pub struct DirworldObservers(pub MultiKeyMap<EntryType, Entity>); +/// A map between file extensions and their corresponding [`Codec`]s #[derive(Default, Resource, Deref, DerefMut)] pub struct DirworldCodecs(pub MultiKeyMap<String, Box<dyn Codec + Send + Sync>>); +/// Type of a filesystem entry #[derive(Debug, PartialEq, Eq, Hash)] pub enum EntryType { + /// A file with an optional extension File(Option<String>), + /// A folder Folder, } -/// Structure containing payload data for cached (non-current) rooms -#[derive(Resource, Default, Debug, Deref, DerefMut)] -pub struct DirworldCache(pub HashMap<PathBuf, DirworldEntityPayload>); |