without

View sourcewithout<T>(component: Constructor<T>): Without<T>

Examples

import { Query, World, without } from '@wimaengine/ecs'

class Position {}
class Parent {}

const world = new World()
world.spawn([new Position()])
world.spawn([new Position(), new Parent()])

const roots = new Query(world, [Position], [without(Parent)])
roots.each(([position]) => {
  // Visits only Position entities without a Parent component.
  console.log(position)
})

Type Parameters

T

Creates a Without QueryFilter for a component constructor.

When a Query uses this filter, an archetype matches only when its complete component TypeId list contains no TypeId derived from component. Other component types are allowed. Its identity type transform preserves the query’s component tuple, and the filter does not add or remove a descriptor. If the same component is listed in the query, it remains required by default; combine with optional when an absent component should be returned as undefined. All configured filters are combined, so this exclusion is applied alongside any other QueryFilter constraints.

The factory only creates the filter; it does not mutate a Query or World.

Parameters

NameDescriptionDefault
component

Component constructor whose TypeId must be absent from matching archetypes.

—

Returns

A filter that excludes archetypes containing component.