From d4c1c7ecb5688ef64f45425d9ac8e7ddeb8e8602 Mon Sep 17 00:00:00 2001 From: Arne Dußin Date: Wed, 3 Feb 2021 10:51:08 +0100 Subject: Fix commands Commands now operate on the local file system, but on the remote world --- src/world/mod.rs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/world') diff --git a/src/world/mod.rs b/src/world/mod.rs index 047ca5c..f163269 100644 --- a/src/world/mod.rs +++ b/src/world/mod.rs @@ -34,6 +34,23 @@ pub struct World { } impl World { + /// Create a world from the raw parts of the world. The components must fit, + /// meaning no id must exist twice and the used ids must correspond to the + /// actually used ids. Use with care. + pub fn from_raw_unchecked( + rooms: StableVec, + walls: StableVec, + icons: StableVec, + used_ids: StableVec<()>, + ) -> Self { + Self { + rooms, + walls, + icons, + used_ids, + } + } + /// Load the world data from a file. Fails if the file does not exist or /// cannot be correctly parsed. pub fn load_from_file>(path: P) -> io::Result { -- cgit v1.2.3-70-g09d2