mirror of
https://github.com/kirirururu/screepsxx.git
synced 2026-06-14 17:30:42 +00:00
29 lines
445 B
C++
29 lines
445 B
C++
#include "Source.hpp"
|
|
|
|
namespace Screeps {
|
|
|
|
Source::Source(JS::Value value) : RoomObject(std::move(value))
|
|
{
|
|
}
|
|
|
|
int Source::energy() const
|
|
{
|
|
return value()["energy"].as<int>();
|
|
}
|
|
|
|
int Source::energyCapacity() const
|
|
{
|
|
return value()["energyCapacity"].as<int>();
|
|
}
|
|
|
|
std::string Source::id() const
|
|
{
|
|
return value()["id"].as<std::string>();
|
|
}
|
|
|
|
int Source::ticksToLive() const
|
|
{
|
|
return value()["ticksToLive"].as<int>();
|
|
}
|
|
|
|
} // namespace Screeps
|