diff options
Diffstat (limited to 'stockton-types/src/world.rs')
-rw-r--r-- | stockton-types/src/world.rs | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/stockton-types/src/world.rs b/stockton-types/src/world.rs index f687f5e..18a0edf 100644 --- a/stockton-types/src/world.rs +++ b/stockton-types/src/world.rs @@ -1,3 +1,18 @@ +// Copyright (C) Oscar Shrimpton 2019 + +// This program is free software: you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the Free +// Software Foundation, either version 3 of the License, or (at your option) +// any later version. + +// This program is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for +// more details. + +// You should have received a copy of the GNU General Public License along +// with this program. If not, see <http://www.gnu.org/licenses/>. + //! The thing you play on and all the associated state. use crate::{EntityStore, Entity}; @@ -19,8 +34,8 @@ impl<'a> World<'a> { /// Returns None if any entities in the map have name conflicts. /// /// `mapper` is called for each BSPEntity to map it to a concrete rust type. - pub fn new<F>(bsp: Pin<Box<BSPFile<'a>>>, mapper: F) -> Option<World<'a>> - where F: Fn(&BSPEntity) -> (Box<Entity>, String) { + pub fn new<F>(bsp: Pin<Box<BSPFile<'a>>>, mut mapper: F) -> Option<World<'a>> + where F: FnMut(&BSPEntity) -> (Box<Entity>, String) { let mut entities: Vec<(Box<Entity>, String)> = Vec::with_capacity(bsp.entities.entities.len()); for bsp_ent in bsp.entities.entities.iter() { |