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

Method loadState

source/game/StarActorMovementController.cpp:489–496  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

487}
488
489void ActorMovementController::loadState(Json const& state) {
490 setPosition(jsonToVec2F(state.get("position")));
491 setVelocity(jsonToVec2F(state.get("velocity")));
492 setRotation(state.getFloat("rotation"));
493 m_movingDirection.set(DirectionNames.getLeft(state.getString("movingDirection")));
494 m_facingDirection.set(DirectionNames.getLeft(state.getString("facingDirection")));
495 m_crouching.set(state.getBool("crouching"));
496}
497
498void ActorMovementController::setAnchorState(EntityAnchorState anchorState) {
499 doSetAnchorState(anchorState);

Callers

nothing calls this directly

Calls 6

jsonToVec2FFunction · 0.85
getFloatMethod · 0.80
getStringMethod · 0.80
getBoolMethod · 0.80
getMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected