MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / toInt

Method toInt

source/core/StarJson.cpp:200–208  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

198}
199
200int64_t Json::toInt() const {
201 if (type() == Type::Float) {
202 return (int64_t)m_data.get<double>();
203 } else if (type() == Type::Int) {
204 return m_data.get<int64_t>();
205 } else {
206 throw JsonException::format("Improper conversion to int from {}", typeName());
207 }
208}
209
210uint64_t Json::toUInt() const {
211 if (type() == Type::Float) {

Callers 15

MaxSpawnCountRuleMethod · 0.80
loadConfigMethod · 0.80
WorldLayoutMethod · 0.80
addLayerMethod · 0.80
readJsonMethod · 0.80
generateNpcVariantMethod · 0.80
receiveMessageMethod · 0.80
disconnectMethod · 0.80
parseABCMethod · 0.80
drawWorldMethod · 0.80

Calls 2

formatFunction · 0.70
typeFunction · 0.50

Tested by

no test coverage detected