MCPcopy Create free account
hub / github.com/Tencent/UnLua / SuspendOverrides

Method SuspendOverrides

Plugins/UnLua/Source/UnLua/Private/LuaFunction.cpp:166–201  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

164}
165
166void ULuaFunction::SuspendOverrides(UClass* Class)
167{
168 UClass* OrphanedClass;
169 if (const auto Exists = SuspendedOverrides.Find(Class))
170 {
171 OrphanedClass = *Exists;
172 }
173 else
174 {
175 OrphanedClass = MakeOrphanedClass(Class);
176 SuspendedOverrides.Add(Class, OrphanedClass);
177 }
178
179 auto Current = &Class->Children;
180 while (*Current)
181 {
182 auto LuaFunction = Cast<ULuaFunction>(*Current);
183 if (!LuaFunction)
184 {
185 Current = &(*Current)->Next;
186 continue;
187 }
188
189 *Current = LuaFunction->Next;
190 const auto Overridden = LuaFunction->GetOverridden();
191 if (!Overridden || Overridden->GetOuter() != Class)
192 continue;
193
194 LuaFunction->Rename(nullptr, OrphanedClass, RenameFlags);
195 Overridden->Rename(*Overridden->GetName().LeftChop(OverriddenSuffix.Length()), nullptr, RenameFlags);
196
197 const auto OrphanedNext = OrphanedClass->Children;
198 OrphanedClass->Children = LuaFunction;
199 LuaFunction->Next = OrphanedNext;
200 }
201}
202
203void ULuaFunction::ResumeOverrides(UClass* Class)
204{

Callers

nothing calls this directly

Calls 6

MakeOrphanedClassFunction · 0.85
GetOverriddenMethod · 0.80
FindMethod · 0.45
AddMethod · 0.45
GetNameMethod · 0.45
LengthMethod · 0.45

Tested by

no test coverage detected