summaryrefslogtreecommitdiff
path: root/src/mmo/timer.hpp
diff options
context:
space:
mode:
authorBen Longbons <b.r.longbons@gmail.com>2014-03-15 19:34:59 -0700
committerBen Longbons <b.r.longbons@gmail.com>2014-03-16 18:58:48 -0700
commitc812c92d1a1835f0bda783e709481188c8d92225 (patch)
treeb401ede48a088ad1aaed88fe3b997cd26ff7ae08 /src/mmo/timer.hpp
parentde9ee1b9754af9d954487121947352f32d7ebb7e (diff)
downloadtmwa-c812c92d1a1835f0bda783e709481188c8d92225.tar.gz
tmwa-c812c92d1a1835f0bda783e709481188c8d92225.tar.bz2
tmwa-c812c92d1a1835f0bda783e709481188c8d92225.tar.xz
tmwa-c812c92d1a1835f0bda783e709481188c8d92225.zip
Clean up header organization
Diffstat (limited to 'src/mmo/timer.hpp')
-rw-r--r--src/mmo/timer.hpp30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/mmo/timer.hpp b/src/mmo/timer.hpp
new file mode 100644
index 0000000..01b8623
--- /dev/null
+++ b/src/mmo/timer.hpp
@@ -0,0 +1,30 @@
+#ifndef TMWA_MMO_TIMER_HPP
+#define TMWA_MMO_TIMER_HPP
+
+# include "timer.t.hpp"
+
+# include "../sanity.hpp"
+
+# include "../strings/fwd.hpp"
+
+// updated automatically when using milli_clock::now()
+// which is done only by core.cpp
+extern tick_t gettick_cache;
+
+inline
+tick_t gettick(void)
+{
+ return gettick_cache;
+}
+
+/// Do all timers scheduled before tick, and return the number of
+/// milliseconds until the next timer happens
+interval_t do_timer(tick_t tick);
+
+/// Stat a file, and return its modification time, truncated to seconds.
+tick_t file_modified(ZString name);
+
+/// Check if there are any events at all scheduled.
+bool has_timers();
+
+#endif // TMWA_MMO_TIMER_HPP