From e84f3eba125f64b852ae8755df3e1ab78aabeebf Mon Sep 17 00:00:00 2001 From: Aki Date: Mon, 2 Jan 2023 02:08:55 +0100 Subject: Moved EventLog to stats module --- kurator/src/Battle.h | 6 +++--- kurator/src/Campaign.cpp | 4 ++-- kurator/src/EventLog.h | 14 -------------- kurator/src/Summary.cpp | 4 ++-- kurator/src/Summary.h | 7 ++++--- stats/include/kurator/stats/EventLog.h | 17 +++++++++++++++++ 6 files changed, 28 insertions(+), 24 deletions(-) delete mode 100644 kurator/src/EventLog.h create mode 100644 stats/include/kurator/stats/EventLog.h diff --git a/kurator/src/Battle.h b/kurator/src/Battle.h index fd772de..500318a 100644 --- a/kurator/src/Battle.h +++ b/kurator/src/Battle.h @@ -6,9 +6,9 @@ #include #include #include +#include #include -#include "EventLog.h" #include "ForceBalance.h" #include "Scene.h" #include "Session.h" @@ -21,7 +21,7 @@ namespace kurator class Battle : public Scene { public: - using Callback = std::function; + using Callback = std::function; explicit Battle(std::shared_ptr _session); Battle(std::shared_ptr _session, campaign::Scenario scenario, Callback _report={}); virtual ~Battle(); @@ -34,7 +34,7 @@ private: std::shared_ptr session; std::unique_ptr battle; ForceBalance balance; - EventLog log; + stats::EventLog log; float time_factor; Callback report; }; diff --git a/kurator/src/Campaign.cpp b/kurator/src/Campaign.cpp index 9d88518..75daaac 100644 --- a/kurator/src/Campaign.cpp +++ b/kurator/src/Campaign.cpp @@ -11,10 +11,10 @@ #include #include #include +#include #include #include "Battle.h" -#include "EventLog.h" #include "Session.h" @@ -68,7 +68,7 @@ Campaign::update(const float) scenario.ships.push_back(std::move(ship)); } } - auto destroy = [&](const EventLog& log) { log.for_each(Reporter{ships}); }; + auto destroy = [&](const stats::EventLog& log) { log.for_each(Reporter{ships}); }; session->push(std::make_shared(session, std::move(scenario), destroy)); level++; } diff --git a/kurator/src/EventLog.h b/kurator/src/EventLog.h deleted file mode 100644 index c676814..0000000 --- a/kurator/src/EventLog.h +++ /dev/null @@ -1,14 +0,0 @@ -#pragma once - -#include -#include - - -namespace kurator -{ - - -using EventLog = stats::BaseLog; - - -} // namespace kurator diff --git a/kurator/src/Summary.cpp b/kurator/src/Summary.cpp index 2ea7c34..6a52d93 100644 --- a/kurator/src/Summary.cpp +++ b/kurator/src/Summary.cpp @@ -6,9 +6,9 @@ #include #include +#include #include -#include "EventLog.h" #include "Session.h" @@ -24,7 +24,7 @@ struct Dumper }; -Summary::Summary(std::shared_ptr _session, EventLog _events) : +Summary::Summary(std::shared_ptr _session, stats::EventLog _events) : session {std::move(_session)}, events {std::move(_events)} { diff --git a/kurator/src/Summary.h b/kurator/src/Summary.h index e4e32f9..4467d0d 100644 --- a/kurator/src/Summary.h +++ b/kurator/src/Summary.h @@ -2,7 +2,8 @@ #include -#include "EventLog.h" +#include + #include "Session.h" #include "Scene.h" @@ -14,12 +15,12 @@ namespace kurator class Summary : public Scene { public: - Summary(std::shared_ptr _session, EventLog _events); + Summary(std::shared_ptr _session, stats::EventLog _events); void update(float dt) override; void draw() const override; private: std::shared_ptr session; - EventLog events; + stats::EventLog events; }; diff --git a/stats/include/kurator/stats/EventLog.h b/stats/include/kurator/stats/EventLog.h new file mode 100644 index 0000000..353a0cd --- /dev/null +++ b/stats/include/kurator/stats/EventLog.h @@ -0,0 +1,17 @@ +#pragma once + +#include "BaseLog.h" +#include "events.h" + + +namespace kurator +{ +namespace stats +{ + + +using EventLog = BaseLog; + + +} // namespace stats +} // namespace kurator -- cgit v1.1