/// <summary> /// Assigns the value of arg1 to arg2. /// </summary> /// <param name="Args">A ScriptArguments instance.</param> public static void FloatLeftDivisionAssignment(ref ScriptArguments Args) { var Params = Args.GetParameters(); SCMOpcodeParameter FirstParam = Params[0]; FirstParam.Real /= Args[0].Real; Params[0] = FirstParam; }
/// <summary> /// Assigns the value of arg1 to arg2. /// </summary> /// <param name="Args">A ScriptArguments instance.</param> public static void FloatRightMultiplicationAssignment(ref ScriptArguments Args) { var Params = Args.GetParameters(); SCMOpcodeParameter SecondParam = Params[1]; SecondParam.Real *= Args[0].Real; Params[1] = SecondParam; }
/// <summary> /// Assigns the value of arg1 to arg2. /// </summary> /// <param name="Args">A ScriptArguments instance.</param> public static void IntLeftDivisionAssignment(ref ScriptArguments Args) { var Params = Args.GetParameters(); SCMOpcodeParameter FirstParam = Params[0]; FirstParam.Integer /= Args[0].Integer; Params[0] = FirstParam; }
/// <summary> /// Assigns the value of arg1 to arg2. /// </summary> /// <param name="Args">A ScriptArguments instance.</param> public static void IntRightSubtractionAssignment(ref ScriptArguments Args) { var Params = Args.GetParameters(); SCMOpcodeParameter SecondParam = Params[1]; SecondParam.Integer -= Args[0].Integer; Params[1] = SecondParam; }
/// <summary> /// Assigns the value of arg1 to arg2. /// </summary> /// <param name="Args">A ScriptArguments instance.</param> public static void FloatRightDivisionAssignment(ref ScriptArguments Args) { var Params = Args.GetParameters(); SCMOpcodeParameter SecondParam = Params[1]; //I'm assuming the assignment happens right to left here, as that is default for C++. SecondParam.Real /= Args[0].Real; Params[1] = SecondParam; }
/// <summary> /// Assigns the value of arg1 to arg2. /// </summary> /// <param name="Args">A ScriptArguments instance.</param> public static void IntRightAssignment(ref ScriptArguments Args) { var Params = Args.GetParameters(); SCMOpcodeParameter SecondParam = Params[1]; //I'm assuming the assignment happens right to left here, as that is default for C++. SecondParam.Integer = Args[0].Integer; Params[1] = SecondParam; }
/// <summary> /// Starts a new thread on the ScriptMachine. /// </summary> /// <param name="Args">A ScriptArguments instance.</param> public static void StartThread(ref ScriptArguments Args) { Args.GetVM().StartThread((uint)Args.GetIntParameter(0), false); var Threads = Args.GetVM().GetThreads(); SCMThread Thread = Threads[Threads.Count - 1]; var Locals = Thread.Locals.ToArray(); // Copy arguments to locals for (var i = 1u; i < Args.GetParameters().Count; ++i) { if (Args[i].Type == SCMType.EndOfArgList) { break; } /**reinterpret_cast<ScriptInt*>(Thread.Locals.ToArray() + * sizeof(int) * (i - 1)) = args[i].integerValue();*/ byte[] SrcInt = BitConverter.GetBytes(Args[i].IntegerValue()); Array.Copy(SrcInt, 0, Locals, sizeof(int) * (i - 1), SrcInt.Length - 1); Thread.Locals.AddRange(Locals); } }
/// <summary> /// Returns true if arg 1 is more than arg 2. Evaluates from right to left. /// </summary> /// <param name="Args">A ScriptArguments instance.</param> /// <returns></returns> public static bool FloatMoreThanLeft4(ref ScriptArguments Args) { var Params = Args.GetParameters(); return(Params[0].Integer > Params[1].Integer); }
/// <summary> /// Checks if the integer value stored in the local variable is /// greater or equal to the integer value stored in the local variable. /// </summary> /// <param name="Args">A ScriptArguments instance.</param> /// <returns></returns> public static bool IsIntLVarGreaterOrEqualToIntVar(ref ScriptArguments Args) { var Params = Args.GetParameters(); return(Params[0].Integer > Params[1].Integer); }
/// <summary> /// Checks if the value stored in the local variable is greater than the floating-point number. /// </summary> /// <param name="Args">A ScriptArguments instance.</param> /// <returns></returns> public static bool IsFloatLVarGreaterThanNumber(ref ScriptArguments Args) { var Params = Args.GetParameters(); return(Params[0].Integer > Params[1].Integer); }