From a1e9304dc31980703446bdb33246e314bafd3b15 Mon Sep 17 00:00:00 2001 From: Silas Bartha Date: Tue, 24 Dec 2024 00:54:31 -0500 Subject: Switched to bevy_mod_scripting, bevy 0.15 update --- src/resources.rs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'src/resources.rs') 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); /// 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, } @@ -22,18 +23,20 @@ pub struct DirworldCurrentDir{ #[derive(Default, Resource, Deref, DerefMut)] pub struct DirworldTasks(pub BTreeMap>>); +/// A map between file types and their corresponding preload/spawn callback observers #[derive(Debug, Default, Resource, Deref, DerefMut)] pub struct DirworldObservers(pub MultiKeyMap); +/// A map between file extensions and their corresponding [`Codec`]s #[derive(Default, Resource, Deref, DerefMut)] pub struct DirworldCodecs(pub MultiKeyMap>); +/// Type of a filesystem entry #[derive(Debug, PartialEq, Eq, Hash)] pub enum EntryType { + /// A file with an optional extension File(Option), + /// A folder Folder, } -/// Structure containing payload data for cached (non-current) rooms -#[derive(Resource, Default, Debug, Deref, DerefMut)] -pub struct DirworldCache(pub HashMap); -- cgit v1.2.3