Enforce Extended Utilities

by perun
Enforce Extended Utilities

Summary

ENX Utilities extends Enforce Extended with reusable higher-level helpers for asynchronous workflows and lazy sequence processing.

Description

ENX Utilities
ENX Utilities is the companion library for Enforce Extended, bringing reusable asynchronous and LINQ-style programming tools to Arma Reforger scripting.
Compose asynchronous operations with Delay, WhenAll, and WhenAny. Build lazy, strongly typed data pipelines over GeneratorSlim<T> using filtering, projection, flattening, paging, concatenation, aggregation, and other familiar query operations.
Asynchronous task utilities
Wait for several tasks while preserving their input order:
async TaskSlim<array<int>> LoadAll()
{
	array<TaskSlim<int>> tasks = {
		LoadValue(1),
		LoadValue(2),
		LoadValue(3)
	};

	return await ENX_Task.WhenAll(tasks);
}
Race multiple operations and retrieve the first task to finish:
async TaskSlim<int> LoadFirst()
{
	array<TaskSlim<int>> tasks = {
		LoadFromCache(),
		LoadFromServer()
	};

	TaskSlim<int> winner = await ENX_Task.WhenAny(tasks);
	return await winner;
}
Available task utilities:
ENX_Task.Delay
ENX_Task.WhenAll
ENX_Task.WhenAny
WhenAll preserves input order and propagates failures. WhenAny returns the first completed task, including failed tasks, so callers remain in control of error handling.
LINQ-style data pipelines
Transform arrays into lazy, single-pass pipelines:
array<int> result = values.AsEnumerable()
	.Where(value => value > 0)
	.Skip(2)
	.TakeWhile(value => value < 100)
	.Select(value => value * 10)
	.Append(999)
	.ToArray();
Flatten nested collections:
array<int> flattened = groups.AsEnumerable()
	.SelectMany(group => group.AsEnumerable())
	.Distinct()
	.ToArray();
Aggregate values without temporary arrays:
int total = values.AsEnumerable()
	.Where(value => value > 0)
	.Aggregate(0, (sum, value) => sum + value);
Available lazy operators include:
Select, SelectMany, Where, Take, Skip, TakeWhile, SkipWhile, Until, Concat, Append, and Prepend.
Available terminal operators include:
ToArray, HasAny, Any, All, Count, CountWhere, FirstOr, FirstOrWhere, ForEach, and Aggregate.
ENX Utilities uses Enforce Extended’s generic generators, generic tasks, array initialization, and lambda support to provide concise APIs while generating native Enforce Script compatible with Arma Reforger.
The enumerable utilities are designed for lazy, composable processing, allowing generator sequences to be transformed, filtered, stopped conditionally, and converted to or from arrays.

License

Arma Public License (APL)

Rating
100%
Version
1.1.20
Game Version
1.8.0.13
Version size
19.29 KB
Downloads
28
Created
17.08.2026
Last Modified
20.09.2026
ID
7E3D9A2C61F84B05

Dependencies