screepsxx/include/Screeps/Context.hpp
2021-05-30 01:14:25 +03:00

34 lines
582 B
C++

#ifndef SCREEPS_CONTEXT_HPP
#define SCREEPS_CONTEXT_HPP
#include "Game.hpp"
#include "Memory.hpp"
#include "PathFinder.hpp"
#include "RawMemory.hpp"
namespace Screeps {
class Context
{
public:
static Context& getInstance()
{
static Context context;
return context;
}
static void update()
{
Game.setValue(JS::getGlobal("Game"));
Memory.setValue(JS::getGlobal("Memory"));
RawMemory.setValue(JS::getGlobal("RawMemory"));
PathFinder.setValue(JS::getGlobal("PathFinder"));
}
private:
Context() = default;
};
} // namespace Screeps
#endif // SCREEPS_CONTEXT_HPP