| 7 | namespace Star { |
| 8 | |
| 9 | PlayerConfig::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 | |
| 51 | PlayerFactory::PlayerFactory() { |
| 52 | m_config = make_shared<PlayerConfig>(Root::singleton().assets()->json("/player.config").toObject()); |
nothing calls this directly
no test coverage detected