1
0
mirror of https://github.com/VCMP-SqMod/SqMod.git synced 2025-06-16 15:17:13 +02:00

Allow circles to be transformed to area points.

This commit is contained in:
Sandu Liviu Catalin
2020-04-20 16:00:47 +03:00
parent 405c2920e7
commit 2f31a9495a
5 changed files with 91 additions and 0 deletions

View File

@ -548,6 +548,26 @@ public:
return *this;
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Appends values to the end of the Array
///
/// \param func Functor that is continuously called to push values on the stack
///
/// \tparam F Type of functor (usually doesnt need to be defined explicitly)
///
/// \return The Array itself so the call can be chained
///
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
template<class F, class... A>
ArrayBase& AppendFromCounted(F&& func, A &&... a) {
sq_pushobject(vm, GetObj());
for (SQInteger i = 0; func(vm, i, std::forward< A >(a)...); ++i)
{
sq_arrayappend(vm, -2);
}
sq_pop(vm,1); // pop array
return *this;
}
};
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////