CE Iter
Custom foreach iterator
Example
// Following code iterates through the array, skipping index 1 and breaking
// at index 2, so it prints only '0:1' and '2:3' to the console.
var _arr = [1, 2, 3, 4];
while (ce_iter(_arr))
{
if (CE_ITER_INDEX == 1)
{
CE_ITER_CONTINUE;
}
show_debug_message(
ce_string_format("${0}: ${1}", [CE_ITER_INDEX, CE_ITER_VALUE]));
if (CE_ITER_INDEX == 2)
{
CE_ITER_BREAK;
}
}
Installation
Using Catalyst, the open-source package manager for GameMaker Studio 2:
catalyst require slagtand-org/ce-iter
Related
This library is a part of project CE. For more information, please visit the project's repository: https://github.com/slagtand-org/ce