aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniel Schadt <kingdread@gmx.de>2018-06-14 16:09:07 +0200
committerDaniel Schadt <kingdread@gmx.de>2018-06-14 16:09:07 +0200
commit12c1426dc10cc30c58e2c8970d73ca8a98e087fa (patch)
tree945c3e9a02fe5ab3692fcb9ee0170afae4596c6a /src
parent797795cc3a05fd23754400e545351eb998761078 (diff)
downloadevtclib-12c1426dc10cc30c58e2c8970d73ca8a98e087fa.tar.gz
evtclib-12c1426dc10cc30c58e2c8970d73ca8a98e087fa.tar.bz2
evtclib-12c1426dc10cc30c58e2c8970d73ca8a98e087fa.zip
derive getters for Agent
Diffstat (limited to 'src')
-rw-r--r--src/lib.rs15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/lib.rs b/src/lib.rs
index 5b3d661..5875abf 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -21,6 +21,8 @@
extern crate quick_error;
#[macro_use]
extern crate num_derive;
+#[macro_use]
+extern crate getset;
extern crate byteorder;
extern crate fnv;
extern crate num_traits;
@@ -88,18 +90,29 @@ pub enum AgentName {
}
/// An agent.
-#[derive(Debug, Clone)]
+#[derive(Debug, Clone, Getters)]
pub struct Agent {
+ #[get="pub"]
addr: u64,
+ #[get="pub"]
kind: AgentKind,
+ #[get="pub"]
toughness: i16,
+ #[get="pub"]
concentration: i16,
+ #[get="pub"]
healing: i16,
+ #[get="pub"]
condition: i16,
+ #[get="pub"]
name: AgentName,
+ #[get="pub"]
instance_id: u16,
+ #[get="pub"]
first_aware: u64,
+ #[get="pub"]
last_aware: u64,
+ #[get="pub"]
master_agent: Option<u64>,
}