From fa5ddaa570473ece02e0a3bfb35702211d21ce12 Mon Sep 17 00:00:00 2001 From: troido Date: Sat, 3 Oct 2020 15:20:52 +0200 Subject: added dense grass; home is now part of monsterAI component --- src/componentwrapper.rs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/componentwrapper.rs') diff --git a/src/componentwrapper.rs b/src/componentwrapper.rs index 2f12a42..a45f3c0 100644 --- a/src/componentwrapper.rs +++ b/src/componentwrapper.rs @@ -15,7 +15,8 @@ use crate::{ AttackType, Clan, Flag, - Trigger + Trigger, + Stat }, parameter::{Parameter}, fromtoparameter::FromToParameter, @@ -170,14 +171,12 @@ components!(all: } }; Clan (name: String); - Home (home: Pos); - Faction (faction: String) {Faction::from_str(faction.as_str()).ok_or(aerr!("invalid faction name"))?}; + Faction (faction: String) {Faction::from_str(faction.as_str()).map_err(|_|aerr!("invalid faction name '{}'", faction))?}; Interactable (typ: String, arg: Parameter) { - Interactable::parse_from_parameter(&typ, &arg).ok_or(aerr!("invalid interaction {:?} {:?}", typ, arg))? + Interactable::parse_from_parameter(&typ, &arg).ok_or(aerr!("invalid interaction {} {:?}", typ, arg))? }; Loot (loot: Vec<(Template, f64)>); Timer (trigger: Trigger, delay: i64, spread: f64, target_time: Option); - Equipment () {panic!("equipment from parameters not implemented")}; TimeOffset (dtime: i64); Flags (flags: Vec) { Flags( @@ -212,6 +211,8 @@ components!(all: ).collect::, std::boxed::Box>>()? } }; + Stats (skills: HashMap); + Requirements (required_flags: HashSet, blocking_flags: HashSet); ); -- cgit