- Joined
- Apr 27, 2011
- Messages
- 272
Here you go, yet another wrapper.
JASS:
library ForUnitsInRange
//===========================================================================
// ForUnitsInRange by Alain.Mark
//
// -Info-
// -Just a snippet to make units in range enumeration easier.
//
// -How to Use-
// x: x-coordinate of source point
// y: y-coordinate of source point
// r: enumeration range
// "//! runtextmacro ForUnitsInRange("x","y","r")
// (your code here, use "U" for the unit in range being evaluated)
// ex: call KillUnit(U)
// //! runtextmacro EndForUnitsInRange()"
//
//===========================================================================
globals
unit U
group G=CreateGroup()
endglobals
//===========================================================================
//! textmacro ForUnitsInRange takes X, Y, R
call GroupEnumUnitsInRange(G,$X$,$Y$,$R$,null)
loop
set U=FirstOfGroup(G)
exitwhen U==null
//! endtextmacro
//! textmacro EndForUnitsInRange
call GroupRemoveUnit(G,U)
endloop
//! endtextmacro
//===========================================================================
endlibrary
Last edited: