Skip to content

MovementManager ยป Gather

Namespace: Mayo.Manager.Movement
Denpendies: GC.MM


To collect objects and units. The character must already be within range.


async Task GatherAsync(IGameObject, List<Func<bool>>?)
async Task GatherAsync(IUnit, List<Func<bool>>?)
async Task GatherAsync(IModel, List<Func<bool>>?)

Optionally, "stop conditions" can be specified.

Example
var ClosestGameObject = GC.OM.GetClosestGameObject();
if (ClosestGameObject != null)
{
    var CTS = new CancellationTokenSource();
    var IsCanceled = false;

    await GC.MM.GatherAsync(ClosestGameObject, [
        () => CTS.Token.IsCancellationRequested,
        () => IsCanceled
    ]);
}

void Gather(IGameObject, List<Func<bool>>?)
void Gather(IUnit, List<Func<bool>>?)
void Gather(IModel, List<Func<bool>>?)