Peoplemon  0.1.0
Peoplemon 3 game source documentation
LegacyWarn.hpp
Go to the documentation of this file.
1 #ifndef CORE_SCRIPTS_LEGACYWARN_HPP
2 #define CORE_SCRIPTS_LEGACYWARN_HPP
3 
4 #include <BLIB/Logging.hpp>
5 #include <BLIB/Util/FileUtil.hpp>
6 #include <Core/Properties.hpp>
7 #include <string>
8 
9 namespace core
10 {
11 namespace script
12 {
17 struct LegacyWarn {
23  static void warn(const std::string& script);
24 };
25 
26 inline void LegacyWarn::warn(const std::string& script) {
27 #ifdef PEOPLEMON_DEBUG
28  if (bl::util::FileUtil::getExtension(script) == "psc") {
29  BL_LOG_WARN << "Tried to load legacy script: "
30  << bl::util::FileUtil::joinPath(Properties::ScriptPath(), script);
31  }
32 #else
33  (void)script;
34 #endif
35 }
36 
37 } // namespace script
38 } // namespace core
39 
40 #endif
Core classes and functionality for both the editor and game.
static const std::string & ScriptPath()
Definition: Properties.cpp:618
Helper struct to warn when legacy scripts are attempted to load.
Definition: LegacyWarn.hpp:17
static void warn(const std::string &script)
In debug mode logs a warning if the given script is detected to be legacy.
Definition: LegacyWarn.hpp:26