From ee200f3003acdfdfde1a746246a7a4669188eb18 Mon Sep 17 00:00:00 2001 From: troido Date: Mon, 13 Apr 2020 14:16:35 +0200 Subject: spawners now also use timer component and triggers --- src/components/messages.rs | 4 +++- src/components/mod.rs | 4 +--- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src/components') 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 { 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 + pub template: Template } #[derive(Component, Debug, Clone, PartialEq, Eq, Hash)] -- cgit