DIFF

class ScriptCallerSource

Constructors 1

private void ScriptCaller()

ScriptCaller is meant to be created through Create

Methods 5

proto void Init(func fn)

Replaces the current registered func with the new one, throws errors if unsuccessful

proto void Invoke(void param1 = null, void param2 = null, void param3 = null, void param4 = null, void param5 = null, void param6 = null, void param7 = null, void param8 = null, void param9 = null)

Invoke call on the registered func, throws errors if unsuccessful

proto bool IsValid()

Checks if the ScriptCaller is valid

proto bool Equals(notnull ScriptCaller other)

Compares this script caller against another script caller

NoteMay return true even if either one is invalid
class SomeClass
{
	void SomeMethod()
	{
	}
}

void Test()
{
	SomeClass instanceA = new SomeClass();
	SomeClass instanceB = new SomeClass();

	ScriptCaller callerA;
	ScriptCaller callerB;

	//! Two methods that are to the same instance
	callerA = ScriptCaller.Create(instanceA.SomeMethod);
	callerB = ScriptCaller.Create(instanceA.SomeMethod);

	Print(callerA.Equals(callerB)); //! "1"
	Print(callerA == callerB); //! "0"
	Print(callerA); //! "ScriptCaller callerA = ScriptCaller<87bc2d40>"
	Print(callerB); //! "ScriptCaller callerB = ScriptCaller<87bc3600>"

	//! Two methods belonging to different instances
	callerA = ScriptCaller.Create(instanceA.SomeMethod);
	callerB = ScriptCaller.Create(instanceB.SomeMethod);

	Print(callerA.Equals(callerB)); //! "0"
	Print(callerA == callerB); //! "0"
	Print(callerA); //! "ScriptCaller callerA = ScriptCaller<87bc3c40>"
	Print(callerB); //! "ScriptCaller callerB = ScriptCaller<87bc2d40>"
}