mirror of
https://github.com/VCMP-SqMod/SqMod.git
synced 2025-07-29 20:21:48 +02:00
Allow chaining in routines.
Simplifies setup after creation by allowing chaining in methods.
This commit is contained in:
@@ -295,6 +295,12 @@ void Register_Routine(HSQUIRRELVM vm)
|
|||||||
.Prop(_SC("Arguments"), &Routine::GetArguments)
|
.Prop(_SC("Arguments"), &Routine::GetArguments)
|
||||||
// Member Methods
|
// Member Methods
|
||||||
.FmtFunc(_SC("SetTag"), &Routine::SetTag)
|
.FmtFunc(_SC("SetTag"), &Routine::SetTag)
|
||||||
|
.Func(_SC("SetData"), &Routine::ApplyData)
|
||||||
|
.Func(_SC("SetInterval"), &Routine::ApplyInterval)
|
||||||
|
.Func(_SC("SetIterations"), &Routine::ApplyIterations)
|
||||||
|
.Func(_SC("SetSuspended"), &Routine::ApplySuspended)
|
||||||
|
.Func(_SC("SetQuiet"), &Routine::AppplyQuiet)
|
||||||
|
.Func(_SC("SetEndure"), &Routine::ApplyEndure)
|
||||||
.Func(_SC("Terminate"), &Routine::Terminate)
|
.Func(_SC("Terminate"), &Routine::Terminate)
|
||||||
.Func(_SC("GetArgument"), &Routine::GetArgument)
|
.Func(_SC("GetArgument"), &Routine::GetArgument)
|
||||||
);
|
);
|
||||||
|
@@ -443,6 +443,15 @@ public:
|
|||||||
GetValid().mData = data;
|
GetValid().mData = data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* --------------------------------------------------------------------------------------------
|
||||||
|
* Modify the arbitrary user data object.
|
||||||
|
*/
|
||||||
|
Routine & ApplyData(const LightObj & data)
|
||||||
|
{
|
||||||
|
SetData(data);
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
/* --------------------------------------------------------------------------------------------
|
/* --------------------------------------------------------------------------------------------
|
||||||
* Retrieve the execution interval.
|
* Retrieve the execution interval.
|
||||||
*/
|
*/
|
||||||
@@ -459,6 +468,15 @@ public:
|
|||||||
GetValid().mInterval = ClampMin(ConvTo< Interval >::From(itr), static_cast< Interval >(0));
|
GetValid().mInterval = ClampMin(ConvTo< Interval >::From(itr), static_cast< Interval >(0));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* --------------------------------------------------------------------------------------------
|
||||||
|
* Modify the execution interval.
|
||||||
|
*/
|
||||||
|
Routine & ApplyInterval(SQInteger itr)
|
||||||
|
{
|
||||||
|
SetInterval(itr);
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
/* --------------------------------------------------------------------------------------------
|
/* --------------------------------------------------------------------------------------------
|
||||||
* Retrieve the number of iterations.
|
* Retrieve the number of iterations.
|
||||||
*/
|
*/
|
||||||
@@ -475,6 +493,15 @@ public:
|
|||||||
GetValid().mIterations = ConvTo< Iterator >::From(itr);
|
GetValid().mIterations = ConvTo< Iterator >::From(itr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* --------------------------------------------------------------------------------------------
|
||||||
|
* Modify the number of iterations.
|
||||||
|
*/
|
||||||
|
Routine & ApplyIterations(SQInteger itr)
|
||||||
|
{
|
||||||
|
SetIterations(itr);
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
/* --------------------------------------------------------------------------------------------
|
/* --------------------------------------------------------------------------------------------
|
||||||
* See whether the routine is suspended.
|
* See whether the routine is suspended.
|
||||||
*/
|
*/
|
||||||
@@ -491,6 +518,15 @@ public:
|
|||||||
GetValid().mSuspended = toggle;
|
GetValid().mSuspended = toggle;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* --------------------------------------------------------------------------------------------
|
||||||
|
* Set whether the routine should be suspended.
|
||||||
|
*/
|
||||||
|
Routine & ApplySuspended(bool toggle)
|
||||||
|
{
|
||||||
|
SetSuspended(toggle);
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
/* --------------------------------------------------------------------------------------------
|
/* --------------------------------------------------------------------------------------------
|
||||||
* See whether the routine is quite.
|
* See whether the routine is quite.
|
||||||
*/
|
*/
|
||||||
@@ -507,6 +543,15 @@ public:
|
|||||||
GetValid().mQuiet = toggle;
|
GetValid().mQuiet = toggle;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* --------------------------------------------------------------------------------------------
|
||||||
|
* Set whether the routine should be quiet.
|
||||||
|
*/
|
||||||
|
Routine & AppplyQuiet(bool toggle)
|
||||||
|
{
|
||||||
|
SetQuiet(toggle);
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
/* --------------------------------------------------------------------------------------------
|
/* --------------------------------------------------------------------------------------------
|
||||||
* See whether the routine endures.
|
* See whether the routine endures.
|
||||||
*/
|
*/
|
||||||
@@ -523,6 +568,15 @@ public:
|
|||||||
GetValid().mEndure = toggle;
|
GetValid().mEndure = toggle;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* --------------------------------------------------------------------------------------------
|
||||||
|
* Set whether the routine should endure.
|
||||||
|
*/
|
||||||
|
Routine & ApplyEndure(bool toggle)
|
||||||
|
{
|
||||||
|
SetEndure(toggle);
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
/* --------------------------------------------------------------------------------------------
|
/* --------------------------------------------------------------------------------------------
|
||||||
* Retrieve the number of arguments to be forwarded.
|
* Retrieve the number of arguments to be forwarded.
|
||||||
*/
|
*/
|
||||||
|
Reference in New Issue
Block a user