BNM 2.4.0
 
Loading...
Searching...
No Matches
BNM::PropertyBase Struct Reference

Class base for working with il2cpp properties. More...

#include <PropertyBase.hpp>

Public Member Functions

constexpr PropertyBase () noexcept=default
 Create empty property base.
 
 PropertyBase (const PropertyBase &other)=default
 Copy property.
 
 PropertyBase (const IL2CPP::PropertyInfo *info)
 Create property from il2cpp property.
 
PropertyBaseSetInstance (IL2CPP::Il2CppObject *val)
 Set property instance if it's non-static.
 
PropertyBaseoperator[] (void *instance)
 Operator for setting instance.
 
PropertyBaseoperator[] (IL2CPP::Il2CppObject *instance)
 Operator for setting instance.
 
PropertyBaseoperator[] (UnityEngine::Object *instance)
 Operator for setting instance.
 
bool IsValid () const noexcept
 Check if property is valid.
 
std::string str () const
 Get full property name.
 
template<typename NewRet>
Property< NewRet > & cast () const
 Cast event to be able to get and set it.
 

Public Attributes

IL2CPP::PropertyInfo * _data {}
 
MethodBase _getter {}
 
MethodBase _setter {}
 
uint8_t _hasGetter: 1 = false
 
uint8_t _hasSetter: 1 = false
 

Detailed Description

Class base for working with il2cpp properties.

This class provides fields and some basic functions to allow toget and set properties.

Constructor & Destructor Documentation

◆ PropertyBase() [1/2]

BNM::PropertyBase::PropertyBase ( const PropertyBase & other)
inlinedefault

Copy property.

Parameters
otherOther property

◆ PropertyBase() [2/2]

BNM::PropertyBase::PropertyBase ( const IL2CPP::PropertyInfo * info)

Create property from il2cpp property.

Parameters
infoIl2cpp property

Member Function Documentation

◆ IsValid()

bool BNM::PropertyBase::IsValid ( ) const
inlinenoexcept

Check if property is valid.

Returns
State of property

◆ operator[]() [1/3]

PropertyBase & BNM::PropertyBase::operator[] ( IL2CPP::Il2CppObject * instance)
inline

Operator for setting instance.

Parameters
instanceInstance
Returns
Reference to current PropertyBase

◆ operator[]() [2/3]

PropertyBase & BNM::PropertyBase::operator[] ( UnityEngine::Object * instance)
inline

Operator for setting instance.

Parameters
instanceInstance
Returns
Reference to current PropertyBase

◆ operator[]() [3/3]

PropertyBase & BNM::PropertyBase::operator[] ( void * instance)
inline

Operator for setting instance.

Parameters
instanceInstance
Returns
Reference to current PropertyBase

◆ SetInstance()

PropertyBase & BNM::PropertyBase::SetInstance ( IL2CPP::Il2CppObject * val)

Set property instance if it's non-static.

Parameters
instanceInstance
Returns
Reference to current PropertyBase

◆ str()

std::string BNM::PropertyBase::str ( ) const
inlinenodiscard

Get full property name.

Returns string with full property name: ClassFullName.(property name){getter: exists/not exist, setter: exists/not exist} (static)/nothing

Returns
Property's full name or "Dead property"