MCPcopy Create free account
hub / github.com/OGSR/OGSR-Engine / load

Method load

ogsr_engine/COMMON_AI/PATH/patrol_path_storage.cpp:70–109  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

68}
69
70void CPatrolPathStorage::load(IReader& stream)
71{
72 IReader* chunk;
73
74 chunk = stream.open_chunk(0);
75 u32 size = chunk->r_u32();
76 chunk->close();
77
78 m_registry.clear();
79
80 PATROL_REGISTRY::value_type pair;
81
82 chunk = stream.open_chunk(1);
83 for (u32 i = 0; i < size; ++i)
84 {
85 IReader* chunk1;
86 chunk1 = chunk->open_chunk(i);
87
88 IReader* chunk2;
89 chunk2 = chunk1->open_chunk(0);
90 load_data(pair.first, *chunk2);
91 chunk2->close();
92
93 chunk2 = chunk1->open_chunk(1);
94 load_data(pair.second, *chunk2);
95 chunk2->close();
96
97 chunk1->close();
98
99 VERIFY3(m_registry.find(pair.first) == m_registry.end(), "Duplicated patrol path found ", *pair.first);
100
101#ifdef DEBUG
102 pair.second->name(pair.first);
103#endif
104
105 m_registry.insert(pair);
106 }
107
108 chunk->close();
109}
110
111void CPatrolPathStorage::save(IWriter& stream)
112{

Callers

nothing calls this directly

Calls 9

load_dataFunction · 0.85
open_chunkMethod · 0.45
r_u32Method · 0.45
closeMethod · 0.45
clearMethod · 0.45
findMethod · 0.45
endMethod · 0.45
nameMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected