aboutsummaryrefslogtreecommitdiff
path: root/src/statistics/boon.rs
diff options
context:
space:
mode:
authorDaniel Schadt <kingdread@gmx.de>2018-04-27 13:02:04 +0200
committerDaniel Schadt <kingdread@gmx.de>2018-04-27 13:02:04 +0200
commit8423b0c401a484314241391f2f78d129eef704c4 (patch)
tree1ce1ae0730f0dcb98e5f5c43213a77a24a2706c3 /src/statistics/boon.rs
parent85e203629580192413dbaa8156c2b4ca351c4bfc (diff)
downloadevtclib-8423b0c401a484314241391f2f78d129eef704c4.tar.gz
evtclib-8423b0c401a484314241391f2f78d129eef704c4.tar.bz2
evtclib-8423b0c401a484314241391f2f78d129eef704c4.zip
add boon tracking basics
Diffstat (limited to 'src/statistics/boon.rs')
-rw-r--r--src/statistics/boon.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/statistics/boon.rs b/src/statistics/boon.rs
index 4d0348e..912fdb6 100644
--- a/src/statistics/boon.rs
+++ b/src/statistics/boon.rs
@@ -107,6 +107,9 @@ impl BoonQueue {
///
/// * `duration` - The amount of time (in milliseconds) to simulate.
pub fn simulate(&mut self, duration: u64) {
+ if duration == 0 {
+ return;
+ }
let mut remaining = duration;
match self.boon_type {
BoonType::Duration => {
@@ -138,6 +141,11 @@ impl BoonQueue {
self.queue.clear();
}
+ /// Checks if any stacks are left.
+ pub fn is_empty(&self) -> bool {
+ self.queue.is_empty()
+ }
+
/// Calculate when the stacks will have the next visible change.
///
/// This assumes that the stacks will not be modified during this time.