MCPcopy Create free account
hub / github.com/esengine/esengine / matches

Method matches

packages/core/src/ECS/Core/ReactiveQuery.ts:223–236  ·  view source on GitHub ↗

* 检查实体是否匹配查询条件 * * @param entity 要检查的实体 * @returns 是否匹配

(entity: Entity)

Source from the content-addressed store, hash-verified

221 * @returns 是否匹配
222 */
223 public matches(entity: Entity): boolean {
224 const entityMask = entity.componentMask;
225
226 switch (this._condition.type) {
227 case QueryConditionType.ALL:
228 return BitMask64Utils.hasAll(entityMask, this._condition.mask);
229 case QueryConditionType.ANY:
230 return BitMask64Utils.hasAny(entityMask, this._condition.mask);
231 case QueryConditionType.NONE:
232 return BitMask64Utils.hasNone(entityMask, this._condition.mask);
233 default:
234 return false;
235 }
236 }
237
238 /**
239 * 通知实体添加

Callers 3

notifyEntityAddedMethod · 0.95
notifyEntityChangedMethod · 0.95
initializeWithMethod · 0.95

Calls 3

hasAllMethod · 0.45
hasAnyMethod · 0.45
hasNoneMethod · 0.45

Tested by

no test coverage detected