WorldQuery beta
Interface of @v12-engine/engine
export interface WorldQuery extends UnitConditionWhat a query of the world asks (world.query): each part it says must hold. What a UnitCondition says too (a buff, health under a share, a hero, tags, enemy or ally of of)
Members
area
area?: string;Only what is inside this area (defineArea, a region of the map)
dead
dead?: boolean | 'only';The dead as well (true), or the dead alone ('only'). The living alone when left out
except
except?: Entity | readonly Entity[];Not these: the caster, the one already hit
hidden
hidden?: boolean;What is out of the world for now as well (a worker in a mine, a unit in a transport). Left out when left out
kinds
kinds?: readonly EntityKind[];Only these kinds of things (unit, building, resource…). Everything when left out
layers
layers?: readonly Layer[];Only what is there: on the ground or in the air. Both when left out
limit
limit?: number;At most this many, the first of the order
near
near?: Vec2 | Entity;Around this point or unit: within radius of it, and what nearest and farthest sort by
of
of?: PlayerId;Whose eyes is (enemy or ally) looks with: the owner of near, where that is a unit, when left out
owner
owner?: PlayerId | readonly PlayerId[];Only what these players own
radius
radius?: number;How far from near (to the edge of each, as an effect's radius reaches). Anywhere when left out
sort
sort?: TargetOrder | ((a: Entity, b: Entity) => number);The order to give them in (TargetOrder), or a comparison. In the order they came into the world when left out
type
type?: string | readonly string[];Only these unit types, by id
visibleTo
visibleTo?: PlayerId;Only what this player's team sees now (fog, invisibility)
where
where?: (entity: Entity, world: World) => boolean;Code that says yes or no of each, after the rest: anything the parts above do not say