summaryrefslogtreecommitdiff
path: root/src/components
diff options
context:
space:
mode:
authortroido <troido@protonmail.com>2020-04-13 14:16:35 +0200
committertroido <troido@protonmail.com>2020-04-13 14:16:35 +0200
commitee200f3003acdfdfde1a746246a7a4669188eb18 (patch)
treeb15ac6b53f52e72b586c529fba550368e1ca6f68 /src/components
parentab67714238c162646af10334715c6de41939c83f (diff)
spawners now also use timer component and triggers
Diffstat (limited to 'src/components')
-rw-r--r--src/components/messages.rs4
-rw-r--r--src/components/mod.rs4
2 files changed, 4 insertions, 4 deletions
diff --git a/src/components/messages.rs b/src/components/messages.rs
index aa928f0..2c0ffd5 100644
--- a/src/components/messages.rs
+++ b/src/components/messages.rs
@@ -79,6 +79,7 @@ pub enum Trigger {
Loot,
Remove,
Build,
+ Spawn,
// combination triggers
Die, // Remove + Loot
Change // Remove + Build
@@ -88,9 +89,10 @@ impl Trigger {
pub fn from_str(txt: &str) -> Option<Self> {
Some(match txt {
"loot" => Self::Loot,
- "die" => Self::Die,
"remove" => Self::Remove,
"build" => Self::Build,
+ "spawn" => Self::Spawn,
+ "die" => Self::Die,
"change" => Self::Change,
_ => {return None}
})
diff --git a/src/components/mod.rs b/src/components/mod.rs
index b1faf08..35f757e 100644
--- a/src/components/mod.rs
+++ b/src/components/mod.rs
@@ -180,10 +180,8 @@ pub struct Home {
#[storage(HashMapStorage)]
pub struct Spawner {
pub amount: usize,
- pub delay: i64,
pub clan: Clan,
- pub template: Template,
- pub last_spawn: Option<Timestamp>
+ pub template: Template
}
#[derive(Component, Debug, Clone, PartialEq, Eq, Hash)]