summaryrefslogtreecommitdiff
path: root/src/componentwrapper.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/componentwrapper.rs')
-rw-r--r--src/componentwrapper.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/componentwrapper.rs b/src/componentwrapper.rs
index e1b5bb8..638d156 100644
--- a/src/componentwrapper.rs
+++ b/src/componentwrapper.rs
@@ -21,6 +21,7 @@ use crate::{
fromtoparameter::FromToParameter,
Timestamp,
Template,
+ exchange::Exchange,
Pos,
Result,
aerr
@@ -235,6 +236,17 @@ components!(all:
};
Substitute (into: Template);
Talkable (text: String);
+ Exchanger (prefix: String, exchanges: Vec<(String, Vec<ItemId>, Vec<ItemId>)>) {
+ Exchanger {
+ prefix,
+ exchanges: exchanges
+ .into_iter()
+ .map(|(key, cost, offer)|
+ (key, Exchange{cost, offer})
+ )
+ .collect()
+ }
+ };
);