MCPcopy Create free account
hub / github.com/OpenArkStudio/ARK / CreateMap

Method CreateMap

src/plugin/kernel/src/AFCMapModule.cpp:120–146  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

118}
119
120bool AFCMapModule::CreateMap(const int map_id)
121{
122 auto pMapInfo = map_infos_.find_value(map_id);
123 if (pMapInfo != nullptr)
124 {
125 return false;
126 }
127
128 pMapInfo = std::make_shared<AFMapInfo>();
129 if (pMapInfo == nullptr)
130 {
131 return false;
132 }
133
134 map_infos_.insert(map_id, pMapInfo);
135
136 // create group 0
137 auto pMapInst = std::make_shared<AFMapInstance>(0);
138 if (nullptr == pMapInst)
139 {
140 return false;
141 }
142
143 pMapInfo->AddInstance(0, pMapInst);
144 ARK_LOG_INFO("Create scene success, map={} inst=0", map_id);
145 return true;
146}
147
148bool AFCMapModule::DestroyMap(const int map_id)
149{

Callers 1

PostInitMethod · 0.80

Calls 3

AddInstanceMethod · 0.80
find_valueMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected