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

Method PlayerConfig

source/game/StarPlayerFactory.cpp:9–49  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7namespace Star {
8
9PlayerConfig::PlayerConfig(JsonObject const& cfg) {
10 defaultIdentity = HumanoidIdentity(cfg.value("defaultHumanoidIdentity"));
11 humanoidTiming = Humanoid::HumanoidTiming(cfg.value("humanoidTiming"));
12
13 for (Json v : cfg.value("defaultItems", JsonArray()).toArray())
14 defaultItems.append(ItemDescriptor(v));
15
16 for (Json v : cfg.value("defaultBlueprints", JsonObject()).getArray("tier1", JsonArray()))
17 defaultBlueprints.append(ItemDescriptor(v));
18
19 metaBoundBox = jsonToRectF(cfg.get("metaBoundBox"));
20
21 movementParameters = cfg.get("movementParameters");
22 zeroGMovementParameters = cfg.get("zeroGMovementParameters");
23 statusControllerSettings = cfg.get("statusControllerSettings");
24
25 footstepTiming = cfg.get("footstepTiming").toFloat();
26 footstepSensor = jsonToVec2F(cfg.get("footstepSensor"));
27
28 underwaterSensor = jsonToVec2F(cfg.get("underwaterSensor"));
29 underwaterMinWaterLevel = cfg.get("underwaterMinWaterLevel").toFloat();
30
31 splashConfig = EntitySplashConfig(cfg.get("splashConfig"));
32
33 companionsConfig = cfg.get("companionsConfig");
34
35 deploymentConfig = cfg.get("deploymentConfig");
36
37 effectsAnimator = cfg.get("effectsAnimator").toString();
38
39 teleportInTime = cfg.get("teleportInTime").toFloat();
40 teleportOutTime = cfg.get("teleportOutTime").toFloat();
41
42 deployInTime = cfg.get("deployInTime").toFloat();
43 deployOutTime = cfg.get("deployOutTime").toFloat();
44
45 bodyMaterialKind = cfg.get("bodyMaterialKind").toString();
46
47 for (auto& p : cfg.get("genericScriptContexts").optObject().value(JsonObject()))
48 genericScriptContexts[p.first] = p.second.toString();
49}
50
51PlayerFactory::PlayerFactory() {
52 m_config = make_shared<PlayerConfig>(Root::singleton().assets()->json("/player.config").toObject());

Callers

nothing calls this directly

Calls 14

HumanoidIdentityClass · 0.85
HumanoidTimingClass · 0.85
ItemDescriptorClass · 0.85
jsonToRectFFunction · 0.85
jsonToVec2FFunction · 0.85
EntitySplashConfigClass · 0.85
toArrayMethod · 0.80
getArrayMethod · 0.80
toFloatMethod · 0.80
optObjectMethod · 0.80
valueMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected