public PMGExecuteList(object owner, FunctionOwnerType ownerT, PMGActor actor) { // The owner of the execution list (event or method) if (owner == null) { throw new System.ArgumentNullException("owner"); } _owner = owner; _ownerType = ownerT; // The actor that owns the owner (yaya too meta shut up) _actor = actor; }
/* * USER DEFINED FUNCTIONS */ public void UF_DebugWriteToConsole(PMGActor actor, object owner, FunctionOwnerType ownerType) { // Write a message to console for testing purposes. Console.WriteLine("Utility functions called. "); // Get owner as method (this is for testing so we know it's a method) PMGMethod ownerM = owner as PMGMethod; // if an int is in stack that is over 1k (we push 1337 by default) // Then we change the value function to #1 (instead of #0) // In this case pushing 42 instead int intFromStack = System.Convert.ToInt32(ownerM._valueStack.GetValueOfType(ValueType.INT)); if (intFromStack > 1000) { Console.WriteLine("Changing value function in owner method steps!"); ownerM.CurrentStep._functions[0] = new PMGValueFunction(1); ownerM.Reset(); } }
public void UF_PushLeetToActor(PMGActor actor, object owner, FunctionOwnerType ownerType) { // push 1337 to actor stack actor.ValueStack.Push(1337); }
public void UF_DoNothing(PMGActor actor, object owner, FunctionOwnerType ownerType) { // literally do nothing }
public void UF_DoNothing(PMGActor actor, object owner, FunctionOwnerType ownerType) { // literally do nothing //Console.WriteLine("youre a wizard"); }
// used for utility function public virtual void Do(PMGActor actor, object owner, FunctionOwnerType ownerType) { throw new System.InvalidOperationException("Virtual method Do(PMGActor actor) called when it shouldn't be (wrong arguments or casting when calling derived overriden function?)"); }
public override void Do(PMGActor actor, object owner, FunctionOwnerType ownerType) { // call correct utility function actor.Core.UtilityFunctions.Collection[_whichFunction](actor, owner, ownerType); }