summaryrefslogtreecommitdiff
path: root/src/room.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/room.rs')
-rw-r--r--src/room.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/room.rs b/src/room.rs
index 5eaee8e..4fcf658 100644
--- a/src/room.rs
+++ b/src/room.rs
@@ -28,6 +28,7 @@ use super::systems::{
controlinput::ControlInput,
view::View
};
+use super::compwrapper::CompWrapper;
@@ -82,6 +83,14 @@ impl <'a, 'b>Room<'a, 'b> {
pub fn add_obj(&mut self, template: &dyn Assemblage, (x, y): (i32, i32)) -> Entity {
template.build(self.world.create_entity()).with(Position::new(Pos{x, y})).build()
}
+
+ pub fn add_complist(&mut self, template: &Vec<CompWrapper>, (x, y): (i32, i32)) -> Entity{
+ let mut builder = self.world.create_entity();
+ for comp in template {
+ builder = comp.build(builder);
+ }
+ builder.with(Position::new(Pos{x, y})).build()
+ }
}