mirror of
https://github.com/kirirururu/screepsxx.git
synced 2026-06-14 17:30:42 +00:00
21 lines
393 B
C++
21 lines
393 B
C++
#include "Memory.hpp"
|
|
|
|
#include <Screeps/JSON.hpp>
|
|
|
|
namespace Screeps {
|
|
|
|
MemoryObject Memory;
|
|
|
|
MemoryObject::MemoryObject() = default;
|
|
|
|
JSON MemoryObject::operator[](const std::string_view& key)
|
|
{
|
|
return JS::toJSON(value()[key.data()]);
|
|
}
|
|
|
|
void MemoryObject::set(const std::string_view& key, const JSON& value)
|
|
{
|
|
this->value().set(key.data(), JS::fromJSON(value));
|
|
}
|
|
|
|
} // namespace Screeps
|