* 检查实体是否匹配查询条件 * * @param entity 要检查的实体 * @returns 是否匹配
(entity: Entity)
| 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 | * 通知实体添加 |
no test coverage detected