///
/// Internals of the bindings between native and .NET code.
/// Game code shouldn't go here.
///
///
/// Jackson Dunstan, 2017, http://JacksonDunstan.com
///
///
/// MIT
///
// Type definitions
#include "Bindings.h"
// Game type definitions
#include "Game.h"
// For assert()
#include
// For int32_t, etc.
#include
// For malloc(), etc.
#include
// For memset(), etc.
#include
// Support placement new
void* operator new(size_t, void* p)
{
return p;
}
// Macro to put before functions that need to be exposed to C#
#ifdef _WIN32
#define DLLEXPORT extern "C" __declspec(dllexport)
#else
#define DLLEXPORT extern "C"
#endif
////////////////////////////////////////////////////////////////
// C# functions for C++ to call
////////////////////////////////////////////////////////////////
namespace Plugin
{
void (*ReleaseObject)(int32_t handle);
int32_t (*StringNew)(const char* chars);
void (*SetException)(int32_t handle);
int32_t (*ArrayGetLength)(int32_t handle);
int32_t (*EnumerableGetEnumerator)(int32_t handle);
/*BEGIN FUNCTION POINTERS*/
void (*ReleaseSystemDecimal)(int32_t handle);
int32_t (*SystemDecimalConstructorSystemDouble)(double value);
int32_t (*SystemDecimalConstructorSystemUInt64)(uint64_t value);
int32_t (*BoxDecimal)(int32_t valHandle);
int32_t (*UnboxDecimal)(int32_t valHandle);
UnityEngine::Vector3 (*UnityEngineVector3ConstructorSystemSingle_SystemSingle_SystemSingle)(float x, float y, float z);
UnityEngine::Vector3 (*UnityEngineVector3Methodop_AdditionUnityEngineVector3_UnityEngineVector3)(UnityEngine::Vector3& a, UnityEngine::Vector3& b);
int32_t (*BoxVector3)(UnityEngine::Vector3& val);
UnityEngine::Vector3 (*UnboxVector3)(int32_t valHandle);
int32_t (*UnityEngineObjectPropertyGetName)(int32_t thisHandle);
void (*UnityEngineObjectPropertySetName)(int32_t thisHandle, int32_t valueHandle);
int32_t (*UnityEngineComponentPropertyGetTransform)(int32_t thisHandle);
UnityEngine::Vector3 (*UnityEngineTransformPropertyGetPosition)(int32_t thisHandle);
void (*UnityEngineTransformPropertySetPosition)(int32_t thisHandle, UnityEngine::Vector3& value);
int32_t (*SystemCollectionsIEnumeratorPropertyGetCurrent)(int32_t thisHandle);
int32_t (*SystemCollectionsIEnumeratorMethodMoveNext)(int32_t thisHandle);
int32_t (*UnityEngineGameObjectMethodAddComponentMyGameBaseBallScript)(int32_t thisHandle);
int32_t (*UnityEngineGameObjectMethodCreatePrimitiveUnityEnginePrimitiveType)(UnityEngine::PrimitiveType type);
void (*UnityEngineDebugMethodLogSystemObject)(int32_t messageHandle);
int32_t (*UnityEngineMonoBehaviourPropertyGetTransform)(int32_t thisHandle);
int32_t (*SystemExceptionConstructorSystemString)(int32_t messageHandle);
int32_t (*BoxPrimitiveType)(UnityEngine::PrimitiveType val);
UnityEngine::PrimitiveType (*UnboxPrimitiveType)(int32_t valHandle);
System::Single (*UnityEngineTimePropertyGetDeltaTime)();
void (*ReleaseBaseBallScript)(int32_t handle);
void (*BaseBallScriptConstructor)(int32_t cppHandle, int32_t* handle);
int32_t (*BoxBoolean)(uint32_t val);
int32_t (*UnboxBoolean)(int32_t valHandle);
int32_t (*BoxSByte)(int8_t val);
System::SByte (*UnboxSByte)(int32_t valHandle);
int32_t (*BoxByte)(uint8_t val);
System::Byte (*UnboxByte)(int32_t valHandle);
int32_t (*BoxInt16)(int16_t val);
System::Int16 (*UnboxInt16)(int32_t valHandle);
int32_t (*BoxUInt16)(uint16_t val);
System::UInt16 (*UnboxUInt16)(int32_t valHandle);
int32_t (*BoxInt32)(int32_t val);
System::Int32 (*UnboxInt32)(int32_t valHandle);
int32_t (*BoxUInt32)(uint32_t val);
System::UInt32 (*UnboxUInt32)(int32_t valHandle);
int32_t (*BoxInt64)(int64_t val);
System::Int64 (*UnboxInt64)(int32_t valHandle);
int32_t (*BoxUInt64)(uint64_t val);
System::UInt64 (*UnboxUInt64)(int32_t valHandle);
int32_t (*BoxChar)(uint16_t val);
int16_t (*UnboxChar)(int32_t valHandle);
int32_t (*BoxSingle)(float val);
System::Single (*UnboxSingle)(int32_t valHandle);
int32_t (*BoxDouble)(double val);
System::Double (*UnboxDouble)(int32_t valHandle);
/*END FUNCTION POINTERS*/
}
////////////////////////////////////////////////////////////////
// Global variables
////////////////////////////////////////////////////////////////
namespace Plugin
{
System::String NullString(nullptr);
}
////////////////////////////////////////////////////////////////
// Plugin Types
////////////////////////////////////////////////////////////////
namespace Plugin
{
ManagedType::ManagedType()
: Handle(0)
{
}
ManagedType::ManagedType(decltype(nullptr))
: Handle(0)
{
}
ManagedType::ManagedType(Plugin::InternalUse iu, int32_t handle)
: Handle(handle)
{
}
}
////////////////////////////////////////////////////////////////
// C# Primitive Types
////////////////////////////////////////////////////////////////
namespace System
{
Boolean::Boolean()
: Value(0)
{
}
Boolean::Boolean(bool value)
: Value((int32_t)value)
{
}
Boolean::Boolean(int32_t value)
: Value(value)
{
}
Boolean::Boolean(uint32_t value)
: Value(value)
{
}
Boolean::operator bool() const
{
return (bool)Value;
}
Boolean::operator int32_t() const
{
return Value;
}
Boolean::operator uint32_t() const
{
return Value;
}
Boolean::operator Object() const
{
return Object(Plugin::InternalUse::Only, Plugin::BoxBoolean(Value));
}
Boolean::operator ValueType() const
{
return ValueType(Plugin::InternalUse::Only, Plugin::BoxBoolean(Value));
}
Boolean::operator IComparable() const
{
return IComparable(Plugin::InternalUse::Only, Plugin::BoxBoolean(Value));
}
Boolean::operator IFormattable() const
{
return IFormattable(Plugin::InternalUse::Only, Plugin::BoxBoolean(Value));
}
Boolean::operator IConvertible() const
{
return IConvertible(Plugin::InternalUse::Only, Plugin::BoxBoolean(Value));
}
Boolean::operator IComparable_1() const
{
return IComparable_1(Plugin::InternalUse::Only, Plugin::BoxBoolean(Value));
}
Boolean::operator IEquatable_1() const
{
return IEquatable_1(Plugin::InternalUse::Only, Plugin::BoxBoolean(Value));
}
Char::Char()
: Value(0)
{
}
Char::Char(char value)
: Value(value)
{
}
Char::Char(int16_t value)
: Value(value)
{
}
Char::operator int16_t() const
{
return Value;
}
Char::operator Object() const
{
return Object(Plugin::InternalUse::Only, Plugin::BoxChar(Value));
}
Char::operator ValueType() const
{
return ValueType(Plugin::InternalUse::Only, Plugin::BoxChar(Value));
}
Char::operator IComparable() const
{
return IComparable(Plugin::InternalUse::Only, Plugin::BoxChar(Value));
}
Char::operator IFormattable() const
{
return IFormattable(Plugin::InternalUse::Only, Plugin::BoxChar(Value));
}
Char::operator IConvertible() const
{
return IConvertible(Plugin::InternalUse::Only, Plugin::BoxChar(Value));
}
Char::operator IComparable_1() const
{
return IComparable_1(Plugin::InternalUse::Only, Plugin::BoxChar(Value));
}
Char::operator IEquatable_1() const
{
return IEquatable_1(Plugin::InternalUse::Only, Plugin::BoxChar(Value));
}
SByte::SByte()
: Value(0)
{
}
SByte::SByte(int8_t val)
: Value(val)
{
}
SByte::operator int8_t() const
{
return Value;
}
SByte::operator Object() const
{
return Object(Plugin::InternalUse::Only, Plugin::BoxSByte(Value));
}
SByte::operator ValueType() const
{
return ValueType(Plugin::InternalUse::Only, Plugin::BoxSByte(Value));
}
SByte::operator IComparable() const
{
return IComparable(Plugin::InternalUse::Only, Plugin::BoxSByte(Value));
}
SByte::operator IFormattable() const
{
return IFormattable(Plugin::InternalUse::Only, Plugin::BoxSByte(Value));
}
SByte::operator IConvertible() const
{
return IConvertible(Plugin::InternalUse::Only, Plugin::BoxSByte(Value));
}
SByte::operator IComparable_1() const
{
return IComparable_1(Plugin::InternalUse::Only, Plugin::BoxSByte(Value));
}
SByte::operator IEquatable_1() const
{
return IEquatable_1(Plugin::InternalUse::Only, Plugin::BoxSByte(Value));
}
Byte::Byte()
: Value(0)
{
}
Byte::Byte(uint8_t value)
: Value(value)
{
}
Byte::operator uint8_t() const
{
return Value;
}
Byte::operator Object() const
{
return Object(Plugin::InternalUse::Only, Plugin::BoxByte(Value));
}
Byte::operator ValueType() const
{
return ValueType(Plugin::InternalUse::Only, Plugin::BoxByte(Value));
}
Byte::operator IComparable() const
{
return IComparable(Plugin::InternalUse::Only, Plugin::BoxByte(Value));
}
Byte::operator IFormattable() const
{
return IFormattable(Plugin::InternalUse::Only, Plugin::BoxByte(Value));
}
Byte::operator IConvertible() const
{
return IConvertible(Plugin::InternalUse::Only, Plugin::BoxByte(Value));
}
Byte::operator IComparable_1() const
{
return IComparable_1(Plugin::InternalUse::Only, Plugin::BoxByte(Value));
}
Byte::operator IEquatable_1() const
{
return IEquatable_1(Plugin::InternalUse::Only, Plugin::BoxByte(Value));
}
Int16::Int16()
: Value(0)
{
}
Int16::Int16(int16_t value)
: Value(value)
{
}
Int16::operator int16_t() const
{
return Value;
}
Int16::operator Object() const
{
return Object(Plugin::InternalUse::Only, Plugin::BoxInt16(Value));
}
Int16::operator ValueType() const
{
return ValueType(Plugin::InternalUse::Only, Plugin::BoxInt16(Value));
}
Int16::operator IComparable() const
{
return IComparable(Plugin::InternalUse::Only, Plugin::BoxInt16(Value));
}
Int16::operator IFormattable() const
{
return IFormattable(Plugin::InternalUse::Only, Plugin::BoxInt16(Value));
}
Int16::operator IConvertible() const
{
return IConvertible(Plugin::InternalUse::Only, Plugin::BoxInt16(Value));
}
Int16::operator IComparable_1() const
{
return IComparable_1(Plugin::InternalUse::Only, Plugin::BoxInt16(Value));
}
Int16::operator IEquatable_1() const
{
return IEquatable_1(Plugin::InternalUse::Only, Plugin::BoxInt16(Value));
}
UInt16::UInt16()
: Value(0)
{
}
UInt16::UInt16(uint16_t value)
: Value(value)
{
}
UInt16::operator uint16_t() const
{
return Value;
}
UInt16::operator Object() const
{
return Object(Plugin::InternalUse::Only, Plugin::BoxUInt16(Value));
}
UInt16::operator ValueType() const
{
return ValueType(Plugin::InternalUse::Only, Plugin::BoxUInt16(Value));
}
UInt16::operator IComparable() const
{
return IComparable(Plugin::InternalUse::Only, Plugin::BoxUInt16(Value));
}
UInt16::operator IFormattable() const
{
return IFormattable(Plugin::InternalUse::Only, Plugin::BoxUInt16(Value));
}
UInt16::operator IConvertible() const
{
return IConvertible(Plugin::InternalUse::Only, Plugin::BoxUInt16(Value));
}
UInt16::operator IComparable_1() const
{
return IComparable_1(Plugin::InternalUse::Only, Plugin::BoxUInt16(Value));
}
UInt16::operator IEquatable_1() const
{
return IEquatable_1(Plugin::InternalUse::Only, Plugin::BoxUInt16(Value));
}
Int32::Int32()
: Value(0)
{
}
Int32::Int32(int32_t value)
: Value(value)
{
}
Int32::operator int32_t() const
{
return Value;
}
Int32::operator Object() const
{
return Object(Plugin::InternalUse::Only, Plugin::BoxInt32(Value));
}
Int32::operator ValueType() const
{
return ValueType(Plugin::InternalUse::Only, Plugin::BoxInt32(Value));
}
Int32::operator IComparable() const
{
return IComparable(Plugin::InternalUse::Only, Plugin::BoxInt32(Value));
}
Int32::operator IFormattable() const
{
return IFormattable(Plugin::InternalUse::Only, Plugin::BoxInt32(Value));
}
Int32::operator IConvertible() const
{
return IConvertible(Plugin::InternalUse::Only, Plugin::BoxInt32(Value));
}
Int32::operator IComparable_1() const
{
return IComparable_1(Plugin::InternalUse::Only, Plugin::BoxInt32(Value));
}
Int32::operator IEquatable_1() const
{
return IEquatable_1(Plugin::InternalUse::Only, Plugin::BoxInt32(Value));
}
UInt32::UInt32()
: Value(0)
{
}
UInt32::UInt32(uint32_t value)
: Value(value)
{
}
UInt32::operator uint32_t() const
{
return Value;
}
UInt32::operator Object() const
{
return Object(Plugin::InternalUse::Only, Plugin::BoxUInt32(Value));
}
UInt32::operator ValueType() const
{
return ValueType(Plugin::InternalUse::Only, Plugin::BoxUInt32(Value));
}
UInt32::operator IComparable() const
{
return IComparable(Plugin::InternalUse::Only, Plugin::BoxUInt32(Value));
}
UInt32::operator IFormattable() const
{
return IFormattable(Plugin::InternalUse::Only, Plugin::BoxUInt32(Value));
}
UInt32::operator IConvertible() const
{
return IConvertible(Plugin::InternalUse::Only, Plugin::BoxUInt32(Value));
}
UInt32::operator IComparable_1() const
{
return IComparable_1(Plugin::InternalUse::Only, Plugin::BoxUInt32(Value));
}
UInt32::operator IEquatable_1() const
{
return IEquatable_1(Plugin::InternalUse::Only, Plugin::BoxUInt32(Value));
}
Int64::Int64()
: Value(0)
{
}
Int64::Int64(int64_t value)
: Value(value)
{
}
Int64::operator int64_t() const
{
return Value;
}
Int64::operator Object() const
{
return Object(Plugin::InternalUse::Only, Plugin::BoxInt64(Value));
}
Int64::operator ValueType() const
{
return ValueType(Plugin::InternalUse::Only, Plugin::BoxInt64(Value));
}
Int64::operator IComparable() const
{
return IComparable(Plugin::InternalUse::Only, Plugin::BoxInt64(Value));
}
Int64::operator IFormattable() const
{
return IFormattable(Plugin::InternalUse::Only, Plugin::BoxInt64(Value));
}
Int64::operator IConvertible() const
{
return IConvertible(Plugin::InternalUse::Only, Plugin::BoxInt64(Value));
}
Int64::operator IComparable_1() const
{
return IComparable_1(Plugin::InternalUse::Only, Plugin::BoxInt64(Value));
}
Int64::operator IEquatable_1() const
{
return IEquatable_1(Plugin::InternalUse::Only, Plugin::BoxInt64(Value));
}
UInt64::UInt64()
: Value(0)
{
}
UInt64::UInt64(uint64_t value)
: Value(value)
{
}
UInt64::operator uint64_t() const
{
return Value;
}
UInt64::operator Object() const
{
return Object(Plugin::InternalUse::Only, Plugin::BoxUInt64(Value));
}
UInt64::operator ValueType() const
{
return ValueType(Plugin::InternalUse::Only, Plugin::BoxUInt64(Value));
}
UInt64::operator IComparable() const
{
return IComparable(Plugin::InternalUse::Only, Plugin::BoxUInt64(Value));
}
UInt64::operator IFormattable() const
{
return IFormattable(Plugin::InternalUse::Only, Plugin::BoxUInt64(Value));
}
UInt64::operator IConvertible() const
{
return IConvertible(Plugin::InternalUse::Only, Plugin::BoxUInt64(Value));
}
UInt64::operator IComparable_1() const
{
return IComparable_1(Plugin::InternalUse::Only, Plugin::BoxUInt64(Value));
}
UInt64::operator IEquatable_1() const
{
return IEquatable_1(Plugin::InternalUse::Only, Plugin::BoxUInt64(Value));
}
Single::Single()
: Value(0.0f)
{
}
Single::Single(float value)
: Value(value)
{
}
Single::operator float() const
{
return Value;
}
Single::operator Object() const
{
return Object(Plugin::InternalUse::Only, Plugin::BoxSingle(Value));
}
Single::operator ValueType() const
{
return ValueType(Plugin::InternalUse::Only, Plugin::BoxSingle(Value));
}
Single::operator IComparable() const
{
return IComparable(Plugin::InternalUse::Only, Plugin::BoxSingle(Value));
}
Single::operator IFormattable() const
{
return IFormattable(Plugin::InternalUse::Only, Plugin::BoxSingle(Value));
}
Single::operator IConvertible() const
{
return IConvertible(Plugin::InternalUse::Only, Plugin::BoxSingle(Value));
}
Single::operator IComparable_1() const
{
return IComparable_1(Plugin::InternalUse::Only, Plugin::BoxSingle(Value));
}
Single::operator IEquatable_1() const
{
return IEquatable_1(Plugin::InternalUse::Only, Plugin::BoxSingle(Value));
}
Double::Double()
: Value(0.0)
{
}
Double::Double(double value)
: Value(value)
{
}
Double::operator double() const
{
return Value;
}
Double::operator Object() const
{
return Object(Plugin::InternalUse::Only, Plugin::BoxDouble(Value));
}
Double::operator ValueType() const
{
return ValueType(Plugin::InternalUse::Only, Plugin::BoxDouble(Value));
}
Double::operator IComparable() const
{
return IComparable(Plugin::InternalUse::Only, Plugin::BoxDouble(Value));
}
Double::operator IFormattable() const
{
return IFormattable(Plugin::InternalUse::Only, Plugin::BoxDouble(Value));
}
Double::operator IConvertible() const
{
return IConvertible(Plugin::InternalUse::Only, Plugin::BoxDouble(Value));
}
Double::operator IComparable_1() const
{
return IComparable_1(Plugin::InternalUse::Only, Plugin::BoxDouble(Value));
}
Double::operator IEquatable_1() const
{
return IEquatable_1(Plugin::InternalUse::Only, Plugin::BoxDouble(Value));
}
}
////////////////////////////////////////////////////////////////
// Support for using IEnumerable with range for loops
////////////////////////////////////////////////////////////////
namespace Plugin
{
// End iterators are dummies full of null
EnumerableIterator::EnumerableIterator(decltype(nullptr))
: enumerator(nullptr)
, hasMore(false)
{
}
// Begin iterators keep track of an IEnumerator
EnumerableIterator::EnumerableIterator(
System::Collections::IEnumerable& enumerable)
: enumerator(enumerable.GetEnumerator())
{
hasMore = enumerator.MoveNext();
}
EnumerableIterator& EnumerableIterator::operator++()
{
hasMore = enumerator.MoveNext();
return *this;
}
bool EnumerableIterator::operator!=(const EnumerableIterator& other)
{
return hasMore;
}
System::Object EnumerableIterator::operator*()
{
return enumerator.GetCurrent();
}
}
////////////////////////////////////////////////////////////////
// User-defined literals for creating decimals (System.Decimal)
////////////////////////////////////////////////////////////////
System::Decimal operator"" _m(long double x)
{
return System::Decimal((System::Double)x);
}
System::Decimal operator"" _m(unsigned long long x)
{
return System::Decimal((System::UInt64)x);
}
////////////////////////////////////////////////////////////////
// Reference counting of managed objects
////////////////////////////////////////////////////////////////
namespace Plugin
{
int32_t RefCountsLenClass;
int32_t* RefCountsClass;
void ReferenceManagedClass(int32_t handle)
{
assert(handle >= 0 && handle < RefCountsLenClass);
if (handle != 0)
{
RefCountsClass[handle]++;
}
}
void DereferenceManagedClass(int32_t handle)
{
assert(handle >= 0 && handle < RefCountsLenClass);
if (handle != 0)
{
int32_t numRemain = --RefCountsClass[handle];
if (numRemain == 0)
{
ReleaseObject(handle);
}
}
}
bool DereferenceManagedClassNoRelease(int32_t handle)
{
assert(handle >= 0 && handle < RefCountsLenClass);
if (handle != 0)
{
int32_t numRemain = --RefCountsClass[handle];
if (numRemain == 0)
{
return true;
}
}
return false;
}
/*BEGIN GLOBAL STATE AND FUNCTIONS*/
int32_t RefCountsLenSystemDecimal;
int32_t* RefCountsSystemDecimal;
void ReferenceManagedSystemDecimal(int32_t handle)
{
assert(handle >= 0 && handle < RefCountsLenSystemDecimal);
if (handle != 0)
{
RefCountsSystemDecimal[handle]++;
}
}
void DereferenceManagedSystemDecimal(int32_t handle)
{
assert(handle >= 0 && handle < RefCountsLenSystemDecimal);
if (handle != 0)
{
int32_t numRemain = --RefCountsSystemDecimal[handle];
if (numRemain == 0)
{
ReleaseSystemDecimal(handle);
}
}
}
// Free list for MyGame::BaseBallScript pointers
int32_t BaseBallScriptFreeListSize;
MyGame::BaseBallScript** BaseBallScriptFreeList;
MyGame::BaseBallScript** NextFreeBaseBallScript;
int32_t StoreBaseBallScript(MyGame::BaseBallScript* del)
{
assert(NextFreeBaseBallScript != nullptr);
MyGame::BaseBallScript** pNext = NextFreeBaseBallScript;
NextFreeBaseBallScript = (MyGame::BaseBallScript**)*pNext;
*pNext = del;
return (int32_t)(pNext - BaseBallScriptFreeList);
}
MyGame::BaseBallScript* GetBaseBallScript(int32_t handle)
{
assert(handle >= 0 && handle < BaseBallScriptFreeListSize);
return BaseBallScriptFreeList[handle];
}
void RemoveBaseBallScript(int32_t handle)
{
MyGame::BaseBallScript** pRelease = BaseBallScriptFreeList + handle;
*pRelease = (MyGame::BaseBallScript*)NextFreeBaseBallScript;
NextFreeBaseBallScript = pRelease;
}
// Free list for whole MyGame::BaseBallScript objects
union BaseBallScriptFreeWholeListEntry
{
BaseBallScriptFreeWholeListEntry* Next;
MyGame::BaseBallScript Value;
};
int32_t BaseBallScriptFreeWholeListSize;
BaseBallScriptFreeWholeListEntry* BaseBallScriptFreeWholeList;
BaseBallScriptFreeWholeListEntry* NextFreeWholeBaseBallScript;
MyGame::BaseBallScript* StoreWholeBaseBallScript()
{
assert(NextFreeWholeBaseBallScript != nullptr);
BaseBallScriptFreeWholeListEntry* pNext = NextFreeWholeBaseBallScript;
NextFreeWholeBaseBallScript = pNext->Next;
return &pNext->Value;
}
void RemoveWholeBaseBallScript(MyGame::BaseBallScript* instance)
{
BaseBallScriptFreeWholeListEntry* pRelease = (BaseBallScriptFreeWholeListEntry*)instance;
if (pRelease >= BaseBallScriptFreeWholeList && pRelease < BaseBallScriptFreeWholeList + (BaseBallScriptFreeWholeListSize - 1))
{
pRelease->Next = NextFreeWholeBaseBallScript;
NextFreeWholeBaseBallScript = pRelease->Next;
}
}
/*END GLOBAL STATE AND FUNCTIONS*/
}
namespace Plugin
{
// An unhandled exception caused by C++ calling into C#
System::Exception* unhandledCsharpException = nullptr;
}
////////////////////////////////////////////////////////////////
// Mirrors of C# types. These wrap the C# functions to present
// a similiar API as in C#.
////////////////////////////////////////////////////////////////
namespace System
{
Object::Object()
: Plugin::ManagedType(nullptr)
{
}
Object::Object(Plugin::InternalUse iu, int32_t handle)
: ManagedType(Plugin::InternalUse::Only, handle)
{
}
Object::Object(decltype(nullptr))
: ManagedType(nullptr)
{
}
bool Object::operator==(decltype(nullptr)) const
{
return Handle == 0;
}
bool Object::operator!=(decltype(nullptr)) const
{
return Handle != 0;
}
void Object::ThrowReferenceToThis()
{
throw *this;
}
ValueType::ValueType(Plugin::InternalUse iu, int32_t handle)
: Object(iu, handle)
{
}
ValueType::ValueType(decltype(nullptr))
: Object(nullptr)
{
}
Enum::Enum(Plugin::InternalUse iu, int32_t handle)
: ValueType(iu, handle)
{
}
Enum::Enum(decltype(nullptr))
: ValueType(nullptr)
{
}
String::String(decltype(nullptr))
: Object(Plugin::InternalUse::Only, 0)
{
}
String::String(Plugin::InternalUse iu, int32_t handle)
: Object(iu, handle)
{
if (handle)
{
Plugin::ReferenceManagedClass(handle);
}
}
String::String(const String& other)
: Object(Plugin::InternalUse::Only, other.Handle)
{
if (Handle)
{
Plugin::ReferenceManagedClass(Handle);
}
}
String::String(String&& other)
: Object(Plugin::InternalUse::Only, other.Handle)
{
other.Handle = 0;
}
String::~String()
{
if (Handle)
{
Plugin::DereferenceManagedClass(Handle);
Handle = 0;
}
}
String& String::operator=(const String& other)
{
if (Handle != other.Handle)
{
if (Handle)
{
Plugin::DereferenceManagedClass(Handle);
}
Handle = other.Handle;
if (Handle)
{
Plugin::ReferenceManagedClass(Handle);
}
}
return *this;
}
String& String::operator=(decltype(nullptr))
{
if (Handle)
{
Plugin::DereferenceManagedClass(Handle);
Handle = 0;
}
return *this;
}
String& String::operator=(String&& other)
{
if (Handle)
{
Plugin::DereferenceManagedClass(Handle);
}
Handle = other.Handle;
other.Handle = 0;
return *this;
}
String::String(const char* chars)
: Object(Plugin::InternalUse::Only, Plugin::StringNew(chars))
{
Plugin::ReferenceManagedClass(Handle);
}
ICloneable::ICloneable(Plugin::InternalUse iu, int32_t handle)
: Object(iu, handle)
{
}
ICloneable::ICloneable(decltype(nullptr))
: Object(nullptr)
{
}
namespace Collections
{
IEnumerable::IEnumerable(Plugin::InternalUse iu, int32_t handle)
: Object(iu, handle)
{
}
IEnumerable::IEnumerable(decltype(nullptr))
: Object(nullptr)
{
}
IEnumerator IEnumerable::GetEnumerator()
{
return IEnumerator(
Plugin::InternalUse::Only,
Plugin::EnumerableGetEnumerator(Handle));
}
Plugin::EnumerableIterator begin(
System::Collections::IEnumerable& enumerable)
{
return Plugin::EnumerableIterator(enumerable);
}
Plugin::EnumerableIterator end(
System::Collections::IEnumerable& enumerable)
{
return Plugin::EnumerableIterator(nullptr);
}
ICollection::ICollection(Plugin::InternalUse iu, int32_t handle)
: Object(iu, handle)
, IEnumerable(nullptr)
{
}
ICollection::ICollection(decltype(nullptr))
: Object(nullptr)
, IEnumerable(nullptr)
{
}
IList::IList(Plugin::InternalUse iu, int32_t handle)
: Object(iu, handle)
, IEnumerable(nullptr)
, ICollection(nullptr)
{
}
IList::IList(decltype(nullptr))
: Object(nullptr)
, IEnumerable(nullptr)
, ICollection(nullptr)
{
}
}
Array::Array(Plugin::InternalUse iu, int32_t handle)
: Object(iu, handle)
, ICloneable(nullptr)
, Collections::IEnumerable(nullptr)
, Collections::ICollection(nullptr)
, Collections::IList(nullptr)
{
}
Array::Array(decltype(nullptr))
: Object(nullptr)
, ICloneable(nullptr)
, Collections::IEnumerable(nullptr)
, Collections::ICollection(nullptr)
, Collections::IList(nullptr)
{
}
int32_t Array::GetLength()
{
return Plugin::ArrayGetLength(Handle);
}
int32_t Array::GetRank()
{
return 0;
}
}
/*BEGIN METHOD DEFINITIONS*/
namespace System
{
IFormattable::IFormattable(decltype(nullptr))
{
}
IFormattable::IFormattable(Plugin::InternalUse, int32_t handle)
{
Handle = handle;
if (handle)
{
Plugin::ReferenceManagedClass(handle);
}
}
IFormattable::IFormattable(const IFormattable& other)
: IFormattable(Plugin::InternalUse::Only, other.Handle)
{
}
IFormattable::IFormattable(IFormattable&& other)
: IFormattable(Plugin::InternalUse::Only, other.Handle)
{
other.Handle = 0;
}
IFormattable::~IFormattable()
{
if (Handle)
{
Plugin::DereferenceManagedClass(Handle);
Handle = 0;
}
}
IFormattable& IFormattable::operator=(const IFormattable& other)
{
if (this->Handle)
{
Plugin::DereferenceManagedClass(this->Handle);
}
this->Handle = other.Handle;
if (this->Handle)
{
Plugin::ReferenceManagedClass(this->Handle);
}
return *this;
}
IFormattable& IFormattable::operator=(decltype(nullptr))
{
if (Handle)
{
Plugin::DereferenceManagedClass(Handle);
Handle = 0;
}
return *this;
}
IFormattable& IFormattable::operator=(IFormattable&& other)
{
if (Handle)
{
Plugin::DereferenceManagedClass(Handle);
}
Handle = other.Handle;
other.Handle = 0;
return *this;
}
bool IFormattable::operator==(const IFormattable& other) const
{
return Handle == other.Handle;
}
bool IFormattable::operator!=(const IFormattable& other) const
{
return Handle != other.Handle;
}
}
namespace System
{
IConvertible::IConvertible(decltype(nullptr))
{
}
IConvertible::IConvertible(Plugin::InternalUse, int32_t handle)
{
Handle = handle;
if (handle)
{
Plugin::ReferenceManagedClass(handle);
}
}
IConvertible::IConvertible(const IConvertible& other)
: IConvertible(Plugin::InternalUse::Only, other.Handle)
{
}
IConvertible::IConvertible(IConvertible&& other)
: IConvertible(Plugin::InternalUse::Only, other.Handle)
{
other.Handle = 0;
}
IConvertible::~IConvertible()
{
if (Handle)
{
Plugin::DereferenceManagedClass(Handle);
Handle = 0;
}
}
IConvertible& IConvertible::operator=(const IConvertible& other)
{
if (this->Handle)
{
Plugin::DereferenceManagedClass(this->Handle);
}
this->Handle = other.Handle;
if (this->Handle)
{
Plugin::ReferenceManagedClass(this->Handle);
}
return *this;
}
IConvertible& IConvertible::operator=(decltype(nullptr))
{
if (Handle)
{
Plugin::DereferenceManagedClass(Handle);
Handle = 0;
}
return *this;
}
IConvertible& IConvertible::operator=(IConvertible&& other)
{
if (Handle)
{
Plugin::DereferenceManagedClass(Handle);
}
Handle = other.Handle;
other.Handle = 0;
return *this;
}
bool IConvertible::operator==(const IConvertible& other) const
{
return Handle == other.Handle;
}
bool IConvertible::operator!=(const IConvertible& other) const
{
return Handle != other.Handle;
}
}
namespace System
{
IComparable::IComparable(decltype(nullptr))
{
}
IComparable::IComparable(Plugin::InternalUse, int32_t handle)
{
Handle = handle;
if (handle)
{
Plugin::ReferenceManagedClass(handle);
}
}
IComparable::IComparable(const IComparable& other)
: IComparable(Plugin::InternalUse::Only, other.Handle)
{
}
IComparable::IComparable(IComparable&& other)
: IComparable(Plugin::InternalUse::Only, other.Handle)
{
other.Handle = 0;
}
IComparable::~IComparable()
{
if (Handle)
{
Plugin::DereferenceManagedClass(Handle);
Handle = 0;
}
}
IComparable& IComparable::operator=(const IComparable& other)
{
if (this->Handle)
{
Plugin::DereferenceManagedClass(this->Handle);
}
this->Handle = other.Handle;
if (this->Handle)
{
Plugin::ReferenceManagedClass(this->Handle);
}
return *this;
}
IComparable& IComparable::operator=(decltype(nullptr))
{
if (Handle)
{
Plugin::DereferenceManagedClass(Handle);
Handle = 0;
}
return *this;
}
IComparable& IComparable::operator=(IComparable&& other)
{
if (Handle)
{
Plugin::DereferenceManagedClass(Handle);
}
Handle = other.Handle;
other.Handle = 0;
return *this;
}
bool IComparable::operator==(const IComparable& other) const
{
return Handle == other.Handle;
}
bool IComparable::operator!=(const IComparable& other) const
{
return Handle != other.Handle;
}
}
namespace System
{
IEquatable_1::IEquatable_1(decltype(nullptr))
{
}
IEquatable_1::IEquatable_1(Plugin::InternalUse, int32_t handle)
{
Handle = handle;
if (handle)
{
Plugin::ReferenceManagedClass(handle);
}
}
IEquatable_1::IEquatable_1(const IEquatable_1& other)
: IEquatable_1(Plugin::InternalUse::Only, other.Handle)
{
}
IEquatable_1::IEquatable_1(IEquatable_1&& other)
: IEquatable_1(Plugin::InternalUse::Only, other.Handle)
{
other.Handle = 0;
}
IEquatable_1::~IEquatable_1()
{
if (Handle)
{
Plugin::DereferenceManagedClass(Handle);
Handle = 0;
}
}
IEquatable_1& IEquatable_1::operator=(const IEquatable_1& other)
{
if (this->Handle)
{
Plugin::DereferenceManagedClass(this->Handle);
}
this->Handle = other.Handle;
if (this->Handle)
{
Plugin::ReferenceManagedClass(this->Handle);
}
return *this;
}
IEquatable_1& IEquatable_1::operator=(decltype(nullptr))
{
if (Handle)
{
Plugin::DereferenceManagedClass(Handle);
Handle = 0;
}
return *this;
}
IEquatable_1& IEquatable_1::operator=(IEquatable_1&& other)
{
if (Handle)
{
Plugin::DereferenceManagedClass(Handle);
}
Handle = other.Handle;
other.Handle = 0;
return *this;
}
bool IEquatable_1::operator==(const IEquatable_1& other) const
{
return Handle == other.Handle;
}
bool IEquatable_1::operator!=(const IEquatable_1& other) const
{
return Handle != other.Handle;
}
}
namespace System
{
IEquatable_1::IEquatable_1(decltype(nullptr))
{
}
IEquatable_1::IEquatable_1(Plugin::InternalUse, int32_t handle)
{
Handle = handle;
if (handle)
{
Plugin::ReferenceManagedClass(handle);
}
}
IEquatable_1::IEquatable_1(const IEquatable_1& other)
: IEquatable_1(Plugin::InternalUse::Only, other.Handle)
{
}
IEquatable_1::IEquatable_1(IEquatable_1&& other)
: IEquatable_1(Plugin::InternalUse::Only, other.Handle)
{
other.Handle = 0;
}
IEquatable_1::~IEquatable_1()
{
if (Handle)
{
Plugin::DereferenceManagedClass(Handle);
Handle = 0;
}
}
IEquatable_1& IEquatable_1::operator=(const IEquatable_1& other)
{
if (this->Handle)
{
Plugin::DereferenceManagedClass(this->Handle);
}
this->Handle = other.Handle;
if (this->Handle)
{
Plugin::ReferenceManagedClass(this->Handle);
}
return *this;
}
IEquatable_1& IEquatable_1::operator=(decltype(nullptr))
{
if (Handle)
{
Plugin::DereferenceManagedClass(Handle);
Handle = 0;
}
return *this;
}
IEquatable_1& IEquatable_1::operator=(IEquatable_1&& other)
{
if (Handle)
{
Plugin::DereferenceManagedClass(Handle);
}
Handle = other.Handle;
other.Handle = 0;
return *this;
}
bool IEquatable_1::operator==(const IEquatable_1& other) const
{
return Handle == other.Handle;
}
bool IEquatable_1::operator!=(const IEquatable_1& other) const
{
return Handle != other.Handle;
}
}
namespace System
{
IEquatable_1::IEquatable_1(decltype(nullptr))
{
}
IEquatable_1::IEquatable_1(Plugin::InternalUse, int32_t handle)
{
Handle = handle;
if (handle)
{
Plugin::ReferenceManagedClass(handle);
}
}
IEquatable_1::IEquatable_1(const IEquatable_1& other)
: IEquatable_1(Plugin::InternalUse::Only, other.Handle)
{
}
IEquatable_1::IEquatable_1(IEquatable_1&& other)
: IEquatable_1(Plugin::InternalUse::Only, other.Handle)
{
other.Handle = 0;
}
IEquatable_1::~IEquatable_1()
{
if (Handle)
{
Plugin::DereferenceManagedClass(Handle);
Handle = 0;
}
}
IEquatable_1& IEquatable_1::operator=(const IEquatable_1& other)
{
if (this->Handle)
{
Plugin::DereferenceManagedClass(this->Handle);
}
this->Handle = other.Handle;
if (this->Handle)
{
Plugin::ReferenceManagedClass(this->Handle);
}
return *this;
}
IEquatable_1& IEquatable_1::operator=(decltype(nullptr))
{
if (Handle)
{
Plugin::DereferenceManagedClass(Handle);
Handle = 0;
}
return *this;
}
IEquatable_1& IEquatable_1::operator=(IEquatable_1&& other)
{
if (Handle)
{
Plugin::DereferenceManagedClass(Handle);
}
Handle = other.Handle;
other.Handle = 0;
return *this;
}
bool IEquatable_1::operator==(const IEquatable_1& other) const
{
return Handle == other.Handle;
}
bool IEquatable_1::operator!=(const IEquatable_1& other) const
{
return Handle != other.Handle;
}
}
namespace System
{
IEquatable_1::IEquatable_1(decltype(nullptr))
{
}
IEquatable_1::IEquatable_1(Plugin::InternalUse, int32_t handle)
{
Handle = handle;
if (handle)
{
Plugin::ReferenceManagedClass(handle);
}
}
IEquatable_1::IEquatable_1(const IEquatable_1& other)
: IEquatable_1(Plugin::InternalUse::Only, other.Handle)
{
}
IEquatable_1::IEquatable_1(IEquatable_1&& other)
: IEquatable_1(Plugin::InternalUse::Only, other.Handle)
{
other.Handle = 0;
}
IEquatable_1::~IEquatable_1()
{
if (Handle)
{
Plugin::DereferenceManagedClass(Handle);
Handle = 0;
}
}
IEquatable_1& IEquatable_1::operator=(const IEquatable_1& other)
{
if (this->Handle)
{
Plugin::DereferenceManagedClass(this->Handle);
}
this->Handle = other.Handle;
if (this->Handle)
{
Plugin::ReferenceManagedClass(this->Handle);
}
return *this;
}
IEquatable_1& IEquatable_1::operator=(decltype(nullptr))
{
if (Handle)
{
Plugin::DereferenceManagedClass(Handle);
Handle = 0;
}
return *this;
}
IEquatable_1& IEquatable_1::operator=(IEquatable_1&& other)
{
if (Handle)
{
Plugin::DereferenceManagedClass(Handle);
}
Handle = other.Handle;
other.Handle = 0;
return *this;
}
bool IEquatable_1::operator==(const IEquatable_1& other) const
{
return Handle == other.Handle;
}
bool IEquatable_1::operator!=(const IEquatable_1& other) const
{
return Handle != other.Handle;
}
}
namespace System
{
IEquatable_1::IEquatable_1(decltype(nullptr))
{
}
IEquatable_1::IEquatable_1(Plugin::InternalUse, int32_t handle)
{
Handle = handle;
if (handle)
{
Plugin::ReferenceManagedClass(handle);
}
}
IEquatable_1::IEquatable_1(const IEquatable_1& other)
: IEquatable_1(Plugin::InternalUse::Only, other.Handle)
{
}
IEquatable_1::IEquatable_1(IEquatable_1&& other)
: IEquatable_1(Plugin::InternalUse::Only, other.Handle)
{
other.Handle = 0;
}
IEquatable_1::~IEquatable_1()
{
if (Handle)
{
Plugin::DereferenceManagedClass(Handle);
Handle = 0;
}
}
IEquatable_1& IEquatable_1::operator=(const IEquatable_1& other)
{
if (this->Handle)
{
Plugin::DereferenceManagedClass(this->Handle);
}
this->Handle = other.Handle;
if (this->Handle)
{
Plugin::ReferenceManagedClass(this->Handle);
}
return *this;
}
IEquatable_1& IEquatable_1::operator=(decltype(nullptr))
{
if (Handle)
{
Plugin::DereferenceManagedClass(Handle);
Handle = 0;
}
return *this;
}
IEquatable_1& IEquatable_1::operator=(IEquatable_1&& other)
{
if (Handle)
{
Plugin::DereferenceManagedClass(Handle);
}
Handle = other.Handle;
other.Handle = 0;
return *this;
}
bool IEquatable_1::operator==(const IEquatable_1& other) const
{
return Handle == other.Handle;
}
bool IEquatable_1::operator!=(const IEquatable_1& other) const
{
return Handle != other.Handle;
}
}
namespace System
{
IEquatable_1::IEquatable_1(decltype(nullptr))
{
}
IEquatable_1::IEquatable_1(Plugin::InternalUse, int32_t handle)
{
Handle = handle;
if (handle)
{
Plugin::ReferenceManagedClass(handle);
}
}
IEquatable_1::IEquatable_1(const IEquatable_1& other)
: IEquatable_1(Plugin::InternalUse::Only, other.Handle)
{
}
IEquatable_1::IEquatable_1(IEquatable_1&& other)
: IEquatable_1(Plugin::InternalUse::Only, other.Handle)
{
other.Handle = 0;
}
IEquatable_1::~IEquatable_1()
{
if (Handle)
{
Plugin::DereferenceManagedClass(Handle);
Handle = 0;
}
}
IEquatable_1& IEquatable_1::operator=(const IEquatable_1& other)
{
if (this->Handle)
{
Plugin::DereferenceManagedClass(this->Handle);
}
this->Handle = other.Handle;
if (this->Handle)
{
Plugin::ReferenceManagedClass(this->Handle);
}
return *this;
}
IEquatable_1& IEquatable_1::operator=(decltype(nullptr))
{
if (Handle)
{
Plugin::DereferenceManagedClass(Handle);
Handle = 0;
}
return *this;
}
IEquatable_1& IEquatable_1::operator=(IEquatable_1&& other)
{
if (Handle)
{
Plugin::DereferenceManagedClass(Handle);
}
Handle = other.Handle;
other.Handle = 0;
return *this;
}
bool IEquatable_1::operator==(const IEquatable_1& other) const
{
return Handle == other.Handle;
}
bool IEquatable_1::operator!=(const IEquatable_1& other) const
{
return Handle != other.Handle;
}
}
namespace System
{
IEquatable_1::IEquatable_1(decltype(nullptr))
{
}
IEquatable_1::IEquatable_1(Plugin::InternalUse, int32_t handle)
{
Handle = handle;
if (handle)
{
Plugin::ReferenceManagedClass(handle);
}
}
IEquatable_1::IEquatable_1(const IEquatable_1& other)
: IEquatable_1(Plugin::InternalUse::Only, other.Handle)
{
}
IEquatable_1::IEquatable_1(IEquatable_1&& other)
: IEquatable_1(Plugin::InternalUse::Only, other.Handle)
{
other.Handle = 0;
}
IEquatable_1::~IEquatable_1()
{
if (Handle)
{
Plugin::DereferenceManagedClass(Handle);
Handle = 0;
}
}
IEquatable_1& IEquatable_1::operator=(const IEquatable_1& other)
{
if (this->Handle)
{
Plugin::DereferenceManagedClass(this->Handle);
}
this->Handle = other.Handle;
if (this->Handle)
{
Plugin::ReferenceManagedClass(this->Handle);
}
return *this;
}
IEquatable_1& IEquatable_1::operator=(decltype(nullptr))
{
if (Handle)
{
Plugin::DereferenceManagedClass(Handle);
Handle = 0;
}
return *this;
}
IEquatable_1& IEquatable_1::operator=(IEquatable_1&& other)
{
if (Handle)
{
Plugin::DereferenceManagedClass(Handle);
}
Handle = other.Handle;
other.Handle = 0;
return *this;
}
bool IEquatable_1::operator==(const IEquatable_1& other) const
{
return Handle == other.Handle;
}
bool IEquatable_1::operator!=(const IEquatable_1& other) const
{
return Handle != other.Handle;
}
}
namespace System
{
IEquatable_1::IEquatable_1(decltype(nullptr))
{
}
IEquatable_1::IEquatable_1(Plugin::InternalUse, int32_t handle)
{
Handle = handle;
if (handle)
{
Plugin::ReferenceManagedClass(handle);
}
}
IEquatable_1::IEquatable_1(const IEquatable_1& other)
: IEquatable_1(Plugin::InternalUse::Only, other.Handle)
{
}
IEquatable_1::IEquatable_1(IEquatable_1&& other)
: IEquatable_1(Plugin::InternalUse::Only, other.Handle)
{
other.Handle = 0;
}
IEquatable_1::~IEquatable_1()
{
if (Handle)
{
Plugin::DereferenceManagedClass(Handle);
Handle = 0;
}
}
IEquatable_1& IEquatable_1::operator=(const IEquatable_1& other)
{
if (this->Handle)
{
Plugin::DereferenceManagedClass(this->Handle);
}
this->Handle = other.Handle;
if (this->Handle)
{
Plugin::ReferenceManagedClass(this->Handle);
}
return *this;
}
IEquatable_1& IEquatable_1::operator=(decltype(nullptr))
{
if (Handle)
{
Plugin::DereferenceManagedClass(Handle);
Handle = 0;
}
return *this;
}
IEquatable_1& IEquatable_1::operator=(IEquatable_1&& other)
{
if (Handle)
{
Plugin::DereferenceManagedClass(Handle);
}
Handle = other.Handle;
other.Handle = 0;
return *this;
}
bool IEquatable_1::operator==(const IEquatable_1& other) const
{
return Handle == other.Handle;
}
bool IEquatable_1::operator!=(const IEquatable_1& other) const
{
return Handle != other.Handle;
}
}
namespace System
{
IEquatable_1::IEquatable_1(decltype(nullptr))
{
}
IEquatable_1::IEquatable_1(Plugin::InternalUse, int32_t handle)
{
Handle = handle;
if (handle)
{
Plugin::ReferenceManagedClass(handle);
}
}
IEquatable_1::IEquatable_1(const IEquatable_1& other)
: IEquatable_1(Plugin::InternalUse::Only, other.Handle)
{
}
IEquatable_1::IEquatable_1(IEquatable_1&& other)
: IEquatable_1(Plugin::InternalUse::Only, other.Handle)
{
other.Handle = 0;
}
IEquatable_1::~IEquatable_1()
{
if (Handle)
{
Plugin::DereferenceManagedClass(Handle);
Handle = 0;
}
}
IEquatable_1& IEquatable_1::operator=(const IEquatable_1& other)
{
if (this->Handle)
{
Plugin::DereferenceManagedClass(this->Handle);
}
this->Handle = other.Handle;
if (this->Handle)
{
Plugin::ReferenceManagedClass(this->Handle);
}
return *this;
}
IEquatable_1& IEquatable_1::operator=(decltype(nullptr))
{
if (Handle)
{
Plugin::DereferenceManagedClass(Handle);
Handle = 0;
}
return *this;
}
IEquatable_1& IEquatable_1::operator=(IEquatable_1&& other)
{
if (Handle)
{
Plugin::DereferenceManagedClass(Handle);
}
Handle = other.Handle;
other.Handle = 0;
return *this;
}
bool IEquatable_1::operator==(const IEquatable_1& other) const
{
return Handle == other.Handle;
}
bool IEquatable_1::operator!=(const IEquatable_1& other) const
{
return Handle != other.Handle;
}
}
namespace System
{
IEquatable_1::IEquatable_1(decltype(nullptr))
{
}
IEquatable_1::IEquatable_1(Plugin::InternalUse, int32_t handle)
{
Handle = handle;
if (handle)
{
Plugin::ReferenceManagedClass(handle);
}
}
IEquatable_1::IEquatable_1(const IEquatable_1& other)
: IEquatable_1(Plugin::InternalUse::Only, other.Handle)
{
}
IEquatable_1::IEquatable_1(IEquatable_1&& other)
: IEquatable_1(Plugin::InternalUse::Only, other.Handle)
{
other.Handle = 0;
}
IEquatable_1::~IEquatable_1()
{
if (Handle)
{
Plugin::DereferenceManagedClass(Handle);
Handle = 0;
}
}
IEquatable_1& IEquatable_1::operator=(const IEquatable_1& other)
{
if (this->Handle)
{
Plugin::DereferenceManagedClass(this->Handle);
}
this->Handle = other.Handle;
if (this->Handle)
{
Plugin::ReferenceManagedClass(this->Handle);
}
return *this;
}
IEquatable_1& IEquatable_1::operator=(decltype(nullptr))
{
if (Handle)
{
Plugin::DereferenceManagedClass(Handle);
Handle = 0;
}
return *this;
}
IEquatable_1& IEquatable_1::operator=(IEquatable_1&& other)
{
if (Handle)
{
Plugin::DereferenceManagedClass(Handle);
}
Handle = other.Handle;
other.Handle = 0;
return *this;
}
bool IEquatable_1::operator==(const IEquatable_1& other) const
{
return Handle == other.Handle;
}
bool IEquatable_1::operator!=(const IEquatable_1& other) const
{
return Handle != other.Handle;
}
}
namespace System
{
IEquatable_1::IEquatable_1(decltype(nullptr))
{
}
IEquatable_1::IEquatable_1(Plugin::InternalUse, int32_t handle)
{
Handle = handle;
if (handle)
{
Plugin::ReferenceManagedClass(handle);
}
}
IEquatable_1