MCPcopy Create free account
hub / github.com/Illation/ETEngine / UnregisterLink

Method UnregisterLink

Engine/source/EtFramework/SceneGraph/EntityLink.cpp:147–173  ·  view source on GitHub ↗

------------------------------------ EntityLinkResolver::UnregisterLink

Source from the content-addressed store, hash-verified

145// EntityLinkResolver::UnregisterLink
146//
147void EntityLinkResolver::UnregisterLink(EntityLink* const link)
148{
149 // find the list of links for the id
150 auto const foundIt = m_RegisteredLinks.find(link->id);
151 if (foundIt == m_RegisteredLinks.cend())
152 {
153 return;
154 }
155
156 // find the actual link
157 auto const foundLink = std::find(foundIt->second.begin(), foundIt->second.end(), link);
158 if (foundLink == foundIt->second.cend())
159 {
160 return;
161 }
162
163 // remove it
164 if (foundIt->second.size() > 1u)
165 {
166 std::iter_swap(foundLink, std::prev(foundIt->second.end()));
167 foundIt->second.pop_back();
168 }
169 else
170 {
171 foundIt->second.clear();
172 }
173}
174
175//---------------------------
176// EntityLinkResolver::Clear

Callers 2

EntityLink.cppFile · 0.80
~EntityLinkMethod · 0.80

Calls 2

beginMethod · 0.80
endMethod · 0.80

Tested by

no test coverage detected