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

Method fromJson

source/game/interfaces/StarPhysicsEntity.cpp:7–14  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5namespace Star {
6
7PhysicsMovingCollision PhysicsMovingCollision::fromJson(Json const& json) {
8 PhysicsMovingCollision pmc;
9 pmc.position = json.opt("position").apply(jsonToVec2F).value();
10 pmc.collision = jsonToPolyF(json.get("collision"));
11 pmc.collisionKind = CollisionKindNames.getLeft(json.getString("collisionKind", "block"));
12 pmc.categoryFilter = jsonToPhysicsCategoryFilter(json);
13 return pmc;
14}
15
16RectF PhysicsMovingCollision::boundBox() const {
17 return collision.boundBox().translated(position);

Callers 9

receiveMessageMethod · 0.45
containerItemsCanFitMethod · 0.45
containerAddItemsMethod · 0.45
containerStackItemsMethod · 0.45
containerPutItemsAtMethod · 0.45
containerSwapItemsMethod · 0.45
containerItemApplyMethod · 0.45

Calls 7

jsonToPolyFFunction · 0.85
getStringMethod · 0.80
valueMethod · 0.45
applyMethod · 0.45
optMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected