Returns the int index of this unit. Can be configured by the user to supply a custom unit indexer which won’t break other stdlib components.
public class UnitIndex
Members:
getUnit() returns unitgetIndex() returns intconstruct(unit whichUnit)public function shouldIndex(unit _u) returns boolean
🔧 Configurable. Override it in your map’s config package.
public function getIndexingUnit() returns unit
Returns the currently indexing unit. That’s the last indexed unit or the one about to be deindexed.
public function onUnitDeindex(code func)
Adds a function to be called before a unit is deindexed. Use the getIndexingUnit() function to refer to the deindexing unit.
public function onUnitIndex(code func)
Adds a function to be called after a unit is indexed. Use the getIndexingUnit() function to refer to the indexed unit.
public function unit.getIndex() returns int
🔧 Configurable. Override it in your map’s config package.
public function unit.toUnitIndex() returns UnitIndex
🔧 Configurable. Override it in your map’s config package.
Returns the UnitIndex associated with this unit, creating a new one if necessary.
public function unit.deindex() returns bool
Deindexes a unit. Returns whether the unit was originally indexed.