mirror of
https://github.com/ChronosX88/mta-mono.git
synced 2024-11-22 18:22:20 +00:00
35 lines
693 B
C++
35 lines
693 B
C++
|
#include "stdafx.h"
|
||
|
#include "CMonoObject.h"
|
||
|
|
||
|
CMonoObject::CMonoObject( CMonoClass* pClass, MonoObject* pMonoObect )
|
||
|
{
|
||
|
this->m_pClass = pClass;
|
||
|
this->m_pMonoObect = pMonoObect;
|
||
|
}
|
||
|
|
||
|
CMonoObject::~CMonoObject()
|
||
|
{
|
||
|
}
|
||
|
|
||
|
CMonoClass* CMonoObject::GetClass()
|
||
|
{
|
||
|
return this->m_pClass;
|
||
|
//return this->m_pAssembly->GetClass( mono_object_get_class( this->m_pMonoObect ) );
|
||
|
}
|
||
|
|
||
|
MonoObject* CMonoObject::CallMethod( const char* szMethodName )
|
||
|
{
|
||
|
CMonoClass* pClass = this->GetClass();
|
||
|
|
||
|
if( pClass )
|
||
|
{
|
||
|
MonoMethod* pMonoMethod = pClass->GetMethod( szMethodName );
|
||
|
|
||
|
if( pMonoMethod )
|
||
|
{
|
||
|
return mono_runtime_invoke( pMonoMethod, this->m_pMonoObect, NULL, NULL );
|
||
|
}
|
||
|
}
|
||
|
|
||
|
return NULL;
|
||
|
}
|