diff options
Diffstat (limited to 'stockton-types')
-rw-r--r-- | stockton-types/src/lib.rs | 2 | ||||
-rw-r--r-- | stockton-types/src/world.rs | 19 |
2 files changed, 11 insertions, 10 deletions
diff --git a/stockton-types/src/lib.rs b/stockton-types/src/lib.rs index 5a409d8..bf690f1 100644 --- a/stockton-types/src/lib.rs +++ b/stockton-types/src/lib.rs @@ -14,7 +14,7 @@ // with this program. If not, see <http://www.gnu.org/licenses/>. //! Common types for all stockton crates. -extern crate stockton_bsp; +extern crate stockton_levels; extern crate nalgebra_glm as na; pub mod world; diff --git a/stockton-types/src/world.rs b/stockton-types/src/world.rs index 2c677b7..8294523 100644 --- a/stockton-types/src/world.rs +++ b/stockton-types/src/world.rs @@ -15,18 +15,19 @@ //! The thing you play on and all the associated state. -use stockton_bsp::BSPFile; +use stockton_levels::prelude::*; /// A loaded world. -pub struct World { - pub map: BSPFile +pub struct World<T: MinBSPFeatures> { + pub map: T, } -impl World { - /// Create a new world from a BSPFile. - pub fn new(bsp: BSPFile) -> Option<World> { - Some(World { - map: bsp - }) +impl<T: MinBSPFeatures> World<T> { + /// Create a new world from a level. + /// The level can be any format, as long as it has the required features of a bsp. + pub fn new(map: T) -> World<T> { + World { + map + } } }
\ No newline at end of file |