summaryrefslogtreecommitdiff
path: root/src/nodetimer.h
diff options
context:
space:
mode:
authorLoïc Blot <nerzhul@users.noreply.github.com>2017-06-18 19:55:15 +0200
committerGitHub <noreply@github.com>2017-06-18 19:55:15 +0200
commit4faaadc8d50d6ab7a19d22bd5a760c4b8321a51f (patch)
tree57ce8401a5f6538024c1f19d37d576fba21e147b /src/nodetimer.h
parent8f7785771b9e02b1a1daf7a252550d78ea93053d (diff)
downloadminetest-4faaadc8d50d6ab7a19d22bd5a760c4b8321a51f.tar.gz
minetest-4faaadc8d50d6ab7a19d22bd5a760c4b8321a51f.tar.bz2
minetest-4faaadc8d50d6ab7a19d22bd5a760c4b8321a51f.zip
Cpp11 patchset 11: continue working on constructor style migration (#6004)
Diffstat (limited to 'src/nodetimer.h')
-rw-r--r--src/nodetimer.h22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/nodetimer.h b/src/nodetimer.h
index 0fd43b2a8..e6a8d7608 100644
--- a/src/nodetimer.h
+++ b/src/nodetimer.h
@@ -36,18 +36,18 @@ with this program; if not, write to the Free Software Foundation, Inc.,
class NodeTimer
{
public:
- NodeTimer(): timeout(0.), elapsed(0.) {}
+ NodeTimer() {}
NodeTimer(const v3s16 &position_):
- timeout(0.), elapsed(0.), position(position_) {}
+ position(position_) {}
NodeTimer(f32 timeout_, f32 elapsed_, v3s16 position_):
timeout(timeout_), elapsed(elapsed_), position(position_) {}
~NodeTimer() {}
-
+
void serialize(std::ostream &os) const;
void deSerialize(std::istream &is);
-
- f32 timeout;
- f32 elapsed;
+
+ f32 timeout = 0.0f;
+ f32 elapsed = 0.0f;
v3s16 position;
};
@@ -58,12 +58,12 @@ public:
class NodeTimerList
{
public:
- NodeTimerList(): m_next_trigger_time(-1.), m_time(0.) {}
+ NodeTimerList() {}
~NodeTimerList() {}
-
+
void serialize(std::ostream &os, u8 map_format_version) const;
void deSerialize(std::istream &is, u8 map_format_version);
-
+
// Get timer
NodeTimer get(const v3s16 &p) {
std::map<v3s16, std::multimap<double, NodeTimer>::iterator>::iterator n =
@@ -128,8 +128,8 @@ public:
private:
std::multimap<double, NodeTimer> m_timers;
std::map<v3s16, std::multimap<double, NodeTimer>::iterator> m_iterators;
- double m_next_trigger_time;
- double m_time;
+ double m_next_trigger_time = -1.0;
+ double m_time = 0.0;
};
#endif