Fix naming convention in scripting backend for klass
This commit is contained in:
@@ -277,10 +277,10 @@ void ScriptingObject::ChangeID(const Guid& newId)
|
||||
|
||||
// Update managed instance
|
||||
const auto managedInstance = GetManagedInstance();
|
||||
const auto monoClass = GetClass();
|
||||
if (managedInstance && monoClass)
|
||||
const auto klass = GetClass();
|
||||
if (managedInstance && klass)
|
||||
{
|
||||
const MField* monoIdField = monoClass->GetField(ScriptingObject_id);
|
||||
const MField* monoIdField = klass->GetField(ScriptingObject_id);
|
||||
if (monoIdField)
|
||||
monoIdField->SetValue(managedInstance, &_id);
|
||||
}
|
||||
@@ -344,10 +344,10 @@ bool ScriptingObject::CreateManaged()
|
||||
#endif
|
||||
{
|
||||
// Other thread already created the object before
|
||||
if (const auto monoClass = GetClass())
|
||||
if (const auto klass = GetClass())
|
||||
{
|
||||
// Reset managed to unmanaged pointer
|
||||
MCore::ScriptingObject::SetInternalValues(monoClass, managedInstance, nullptr, nullptr);
|
||||
MCore::ScriptingObject::SetInternalValues(klass, managedInstance, nullptr, nullptr);
|
||||
}
|
||||
MCore::GCHandle::Free(handle);
|
||||
return true;
|
||||
@@ -366,17 +366,17 @@ bool ScriptingObject::CreateManaged()
|
||||
MObject* ScriptingObject::CreateManagedInternal()
|
||||
{
|
||||
// Get class
|
||||
MClass* monoClass = GetClass();
|
||||
if (monoClass == nullptr)
|
||||
MClass* klass = GetClass();
|
||||
if (klass == nullptr)
|
||||
{
|
||||
LOG(Warning, "Missing managed class for object with id {0}", GetID());
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
MObject* managedInstance = MCore::ScriptingObject::CreateScriptingObject(monoClass, this, &_id);
|
||||
MObject* managedInstance = MCore::ScriptingObject::CreateScriptingObject(klass, this, &_id);
|
||||
if (managedInstance == nullptr)
|
||||
{
|
||||
LOG(Warning, "Failed to create new instance of the object of type {0}", String(monoClass->GetFullName()));
|
||||
LOG(Warning, "Failed to create new instance of the object of type {0}", String(klass->GetFullName()));
|
||||
}
|
||||
|
||||
return managedInstance;
|
||||
@@ -393,9 +393,9 @@ void ScriptingObject::DestroyManaged()
|
||||
// Reset managed to unmanaged pointer
|
||||
if (managedInstance)
|
||||
{
|
||||
if (const auto monoClass = GetClass())
|
||||
if (const auto klass = GetClass())
|
||||
{
|
||||
MCore::ScriptingObject::SetInternalValues(monoClass, managedInstance, nullptr, nullptr);
|
||||
MCore::ScriptingObject::SetInternalValues(klass, managedInstance, nullptr, nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -522,10 +522,10 @@ bool ManagedScriptingObject::CreateManaged()
|
||||
#endif
|
||||
{
|
||||
// Other thread already created the object before
|
||||
if (const auto monoClass = GetClass())
|
||||
if (const auto klass = GetClass())
|
||||
{
|
||||
// Reset managed to unmanaged pointer
|
||||
MCore::ScriptingObject::SetInternalValues(monoClass, managedInstance, nullptr, nullptr);
|
||||
MCore::ScriptingObject::SetInternalValues(klass, managedInstance, nullptr, nullptr);
|
||||
}
|
||||
MCore::GCHandle::Free(handle);
|
||||
return true;
|
||||
@@ -684,9 +684,9 @@ DEFINE_INTERNAL_CALL(void) ObjectInternal_ManagedInstanceCreated(MObject* manage
|
||||
actor->SetName(String(typeClass->GetName()));
|
||||
}
|
||||
|
||||
MClass* monoClass = obj->GetClass();
|
||||
MClass* klass = obj->GetClass();
|
||||
const Guid id = obj->GetID();
|
||||
MCore::ScriptingObject::SetInternalValues(monoClass, managedInstance, obj, &id);
|
||||
MCore::ScriptingObject::SetInternalValues(klass, managedInstance, obj, &id);
|
||||
|
||||
// Register object
|
||||
if (!obj->IsRegistered())
|
||||
|
||||
Reference in New Issue
Block a user