mirror of
https://github.com/VCMP-SqMod/SqMod.git
synced 2024-11-08 00:37:15 +01:00
Allow chaining in routines.
Simplifies setup after creation by allowing chaining in methods.
This commit is contained in:
parent
ef0fc103cd
commit
0b0ec9c40c
@ -295,6 +295,12 @@ void Register_Routine(HSQUIRRELVM vm)
|
||||
.Prop(_SC("Arguments"), &Routine::GetArguments)
|
||||
// Member Methods
|
||||
.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("GetArgument"), &Routine::GetArgument)
|
||||
);
|
||||
|
@ -443,6 +443,15 @@ public:
|
||||
GetValid().mData = data;
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Modify the arbitrary user data object.
|
||||
*/
|
||||
Routine & ApplyData(const LightObj & data)
|
||||
{
|
||||
SetData(data);
|
||||
return *this;
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Retrieve the execution interval.
|
||||
*/
|
||||
@ -459,6 +468,15 @@ public:
|
||||
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.
|
||||
*/
|
||||
@ -475,6 +493,15 @@ public:
|
||||
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.
|
||||
*/
|
||||
@ -491,6 +518,15 @@ public:
|
||||
GetValid().mSuspended = toggle;
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Set whether the routine should be suspended.
|
||||
*/
|
||||
Routine & ApplySuspended(bool toggle)
|
||||
{
|
||||
SetSuspended(toggle);
|
||||
return *this;
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* See whether the routine is quite.
|
||||
*/
|
||||
@ -507,6 +543,15 @@ public:
|
||||
GetValid().mQuiet = toggle;
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Set whether the routine should be quiet.
|
||||
*/
|
||||
Routine & AppplyQuiet(bool toggle)
|
||||
{
|
||||
SetQuiet(toggle);
|
||||
return *this;
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* See whether the routine endures.
|
||||
*/
|
||||
@ -523,6 +568,15 @@ public:
|
||||
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.
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user