summaryrefslogtreecommitdiff
path: root/src/attack.rs
diff options
context:
space:
mode:
authortroido <troido@protonmail.com>2020-02-23 21:25:36 +0100
committertroido <troido@protonmail.com>2020-02-23 21:25:36 +0100
commit613952f918b8d72a3e397dc46be309b2320c6ad0 (patch)
tree2f34c1d8fb2aed771a5714a266845df095e5b438 /src/attack.rs
parent9a814769565ab36c227508c47792e112de338df1 (diff)
entities can be attacked
Diffstat (limited to 'src/attack.rs')
-rw-r--r--src/attack.rs17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/attack.rs b/src/attack.rs
new file mode 100644
index 0000000..a0b8b99
--- /dev/null
+++ b/src/attack.rs
@@ -0,0 +1,17 @@
+
+use specs::Entity;
+
+#[derive(Debug, Clone, Default)]
+pub struct Attack {
+ pub damage: i64,
+ pub attacker: Option<Entity>
+}
+
+impl Attack {
+ pub fn new(damage: i64) -> Self {
+ Self {
+ damage,
+ attacker: None
+ }
+ }
+}