MCPcopy Create free account
hub / github.com/REGoth-project/REGoth / exportScriptState

Method exportScriptState

src/logic/NpcScriptState.cpp:503–531  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

501}
502
503void NpcScriptState::exportScriptState(json& j)
504{
505 // Export current state
506 exportState(m_CurrentState, j["currentState"]);
507
508 // Export next state
509 exportState(m_NextState, j["nextState"]);
510
511 j["lastStateSymIndex"] = m_LastStateSymIndex;
512
513 // TODO: Need other/victim/item?
514
515 // Export routine
516 j["routines"] = json::array();
517 for (const RoutineEntry& r : m_Routine.routine)
518 {
519 json jr;
520 jr["hoursStart"] = r.hoursStart;
521 jr["minutesStart"] = r.minutesStart;
522 jr["hoursEnd"] = r.hoursEnd;
523 jr["minutesEnd"] = r.minutesEnd;
524 jr["symFunc"] = r.symFunc;
525 jr["waypoint"] = r.waypoint;
526 jr["isOverlay"] = r.isOverlay;
527
528 j["routines"].push_back(jr);
529 }
530 j["activeRoutineIdx"] = m_Routine.routineActiveIdx;
531}
532
533void NpcScriptState::importScriptState(const json& j)
534{

Callers 1

exportPartMethod · 0.80

Calls 1

push_backMethod · 0.80

Tested by

no test coverage detected