mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-19 16:40:26 +02:00
Moving corlib files out of "System" directory into root
This commit is contained in:
parent
4cd58262e4
commit
7dbfd15292
179 changed files with 3 additions and 0 deletions
40
BeefLibs/corlib/src/Delegate.bf
Normal file
40
BeefLibs/corlib/src/Delegate.bf
Normal file
|
@ -0,0 +1,40 @@
|
|||
namespace System
|
||||
{
|
||||
class Delegate
|
||||
{
|
||||
void* mFuncPtr;
|
||||
void* mTarget;
|
||||
|
||||
public static bool Equals(Delegate a, Delegate b)
|
||||
{
|
||||
if ((Object)a == (Object)b)
|
||||
return true;
|
||||
if ((Object)a == null || (Object)b == null)
|
||||
return false;
|
||||
return (a.mFuncPtr == b.mFuncPtr) && (a.mTarget == b.mTarget);
|
||||
}
|
||||
|
||||
public Result<void*> GetFuncPtr()
|
||||
{
|
||||
if (mTarget != null)
|
||||
return .Err; //("Delegate target method must be static");
|
||||
return mFuncPtr;
|
||||
}
|
||||
|
||||
public void* GetTarget()
|
||||
{
|
||||
return mTarget;
|
||||
}
|
||||
|
||||
public void SetFuncPtr(void* ptr, void* target = null)
|
||||
{
|
||||
mTarget = target;
|
||||
mFuncPtr = ptr;
|
||||
}
|
||||
}
|
||||
|
||||
struct Function : int
|
||||
{
|
||||
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue