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

Method importScriptState

src/logic/NpcScriptState.cpp:533–560  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

531}
532
533void NpcScriptState::importScriptState(const json& j)
534{
535 importState(m_CurrentState, j["currentState"]);
536 importState(m_NextState, j["nextState"]);
537
538 m_LastStateSymIndex = j["lastStateSymIndex"];
539
540 m_Routine.routine.clear();
541 for (const json& jr : j["routines"])
542 {
543 RoutineEntry r;
544 r.hoursStart = jr["hoursStart"];
545 r.minutesStart = jr["minutesStart"];
546 r.hoursEnd = jr["hoursEnd"];
547 r.minutesEnd = jr["minutesEnd"];
548 r.symFunc = jr["symFunc"];
549 r.waypoint = jr["waypoint"];
550 r.isOverlay = jr["isOverlay"];
551
552 m_Routine.routine.push_back(r);
553 }
554
555 m_Routine.routineActiveIdx = j["activeRoutineIdx"];
556 m_Routine.hasRoutine = !m_Routine.routine.empty();
557
558 // Start routine
559 //reinitRoutine();
560}
561
562void NpcScriptState::clearRoutine()
563{

Callers 1

importObjectMethod · 0.80

Calls 3

push_backMethod · 0.80
clearMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected