• API(eca&lua)
  • Lua
  • API
  • Selector

Selector

选取器

用来选取某个区域内的单位

count

(method) Selector:count(count: integer)
  -> Selector

选项 - 选取的数量

create

function Selector.create()
  -> Selector

创建选取器

get

(method) Selector:get()
  -> UnitGroup

进行选取

in_range

(method) Selector:in_range(cent: Item|Point|Unit, radius: number)
  -> Selector

形状 - 在圆形区域内

in_shape

(method) Selector:in_shape(pos: Point, shape: Shape)
  -> Selector

形状 - 添加形状对象

in_state

(method) Selector:in_state(state: integer|y3.Const.UnitEnumState)
  -> Selector

条件 - 拥有某个特定的状态

include_dead

(method) Selector:include_dead()
  -> Selector

选项 - 包含死亡的单位

ipairs

(method) Selector:ipairs()
  -> fun(table: <V>[], i?: integer):integer, <V>
  2. Unit[]
  3. integer

进行遍历

is_ally

(method) Selector:is_ally(p: Player)
  -> Selector

条件 - 是某个玩家的同盟

is_enemy

(method) Selector:is_enemy(p: Player)
  -> Selector

条件 - 是某个玩家的敌人

is_unit_key

(method) Selector:is_unit_key(unit_key: py.UnitKey)
  -> Selector

条件 - 是某个特定的单位类型

is_unit_type

(method) Selector:is_unit_type(unit_type: py.UnitType)
  -> Selector

条件 - 是某个特定的单位类型

is_visible

(method) Selector:is_visible(p: Player)
  -> Selector

条件 - 对某个玩家可见

not_in_group

(method) Selector:not_in_group(ug: UnitGroup)
  -> Selector

条件 - 不在某个单位组中

not_in_state

(method) Selector:not_in_state(state: integer|y3.Const.UnitEnumState)
  -> Selector

条件 - 不拥有某个特定的状态

not_is

(method) Selector:not_is(u: Unit)
  -> Selector

条件 - 不是某个特定的单位

not_visible

(method) Selector:not_visible(p: Player)
  -> Selector

条件 - 对某个玩家不可见

of_player

(method) Selector:of_player(p: Player|PlayerGroup)
  -> Selector

条件 - 属于某个玩家或某个玩家组

pick

(method) Selector:pick()
  -> Unit[]

进行选取

sort_type

(method) Selector:sort_type(st: Selector.SortType)
  -> Selector

排序 - 按照某种方式排序

with_tag

(method) Selector:with_tag(tag: string)
  -> Selector

条件 - 拥有特定标签

without_tag

(method) Selector:without_tag(tag?: string)
  -> Selector

条件 - 不拥有特定标签

Selector.SortType

"由近到远" | "由远到近" | "随机"