public bool MoveToFormation(UnitGroup units) { bool executed = false; for (; units.IsValid(); units.TryMoveNext()) { if (MoveToFormation(units.Current)) { executed = true; } } return(executed); }
public bool MoveToFormation(UnitGroup units) { bool executed = false; while (units.IsValid()) { if (MoveToFormation(units.Current)) { executed = true; units.TryMoveNext(); } else if (spiralPositions.ContainingSquareSize >= maxSize) { executed = OverflowUnits(units); } } return(executed); }
/// <summary> /// Creates a spiral around the provided tile /// </summary> /// <param name="units"></param> public bool MoveToFormation(UnitGroup units) { if (units == null) { return(false); } bool executed = false; while (units.IsValid()) { if (MoveToFormation(units.Current)) { executed = true; } if (!units.TryMoveNext()) { break; } } return(executed); }