diff --git a/src/citymania/cm_survey.cpp b/src/citymania/cm_survey.cpp new file mode 100644 index 0000000000..dc8a403f13 --- /dev/null +++ b/src/citymania/cm_survey.cpp @@ -0,0 +1,17 @@ +#include "../stdafx.h" + +#include "cm_survey.hpp" + +#include "../openttd.h" + +#include "../safeguards.h" + +namespace citymania { + +void SurveyGameSession(nlohmann::json &survey) { + for (auto& [key, value]: _game_session_stats.cm.hotkeys) { + survey["cm_hotkeys"][key] = value; + } +} + +} // namespace citymania diff --git a/src/citymania/cm_survey.hpp b/src/citymania/cm_survey.hpp new file mode 100644 index 0000000000..67e074a30b --- /dev/null +++ b/src/citymania/cm_survey.hpp @@ -0,0 +1,12 @@ +#ifndef CMEXT_SURVEY_HPP +#define CMEXT_SURVEY_HPP + +#include "3rdparty/nlohmann/json.hpp" + +namespace citymania { + +void SurveyGameSession(nlohmann::json &survey); + +} // namespace citymania + +#endif diff --git a/src/citymania/extensions/cmext_game_session_stats.hpp b/src/citymania/extensions/cmext_game_session_stats.hpp new file mode 100644 index 0000000000..2b30beb690 --- /dev/null +++ b/src/citymania/extensions/cmext_game_session_stats.hpp @@ -0,0 +1,17 @@ +#ifndef CMEXT_GAME_SESSION_STATS_HPP +#define CMEXT_GAME_SESSION_STATS_HPP + +namespace citymania { + +namespace ext { + +class GameSessionStats { +public: + std::map hotkeys; +}; + +} // namespace ext + +} // namespace citymania + +#endif