修复querysystem循环依赖的问题

This commit is contained in:
YHH
2025-10-14 17:50:32 +08:00
parent d979c38615
commit 7da5366bca
3 changed files with 39 additions and 33 deletions

View File

@@ -7,39 +7,9 @@ import { getComponentTypeName } from '../Decorators';
import { Archetype, ArchetypeSystem } from './ArchetypeSystem';
import { ComponentTypeManager } from "../Utils";
import { ReactiveQuery, ReactiveQueryConfig } from './ReactiveQuery';
import { QueryCondition, QueryConditionType, QueryResult } from './QueryTypes';
/**
* 查询条件类型
*/
export enum QueryConditionType {
/** 必须包含所有指定组件 */
ALL = 'all',
/** 必须包含任意一个指定组件 */
ANY = 'any',
/** 不能包含任何指定组件 */
NONE = 'none'
}
/**
* 查询条件接口
*/
export interface QueryCondition {
type: QueryConditionType;
componentTypes: ComponentType[];
mask: BitMask64Data;
}
/**
* 实体查询结果接口
*/
export interface QueryResult {
entities: readonly Entity[];
count: number;
/** 查询执行时间(毫秒) */
executionTime: number;
/** 是否来自缓存 */
fromCache: boolean;
}
export { QueryCondition, QueryConditionType, QueryResult };
/**
* 实体索引结构

View File

@@ -0,0 +1,36 @@
import { ComponentType } from './ComponentStorage';
import { BitMask64Data } from '../Utils/BigIntCompatibility';
import { Entity } from '../Entity';
/**
* 查询条件类型
*/
export enum QueryConditionType {
/** 必须包含所有指定组件 */
ALL = 'all',
/** 必须包含任意一个指定组件 */
ANY = 'any',
/** 不能包含任何指定组件 */
NONE = 'none'
}
/**
* 查询条件接口
*/
export interface QueryCondition {
type: QueryConditionType;
componentTypes: ComponentType[];
mask: BitMask64Data;
}
/**
* 实体查询结果接口
*/
export interface QueryResult {
entities: readonly Entity[];
count: number;
/** 查询执行时间(毫秒) */
executionTime: number;
/** 是否来自缓存 */
fromCache: boolean;
}

View File

@@ -1,5 +1,5 @@
import { Entity } from '../Entity';
import { QueryCondition, QueryConditionType } from './QuerySystem';
import { QueryCondition, QueryConditionType } from './QueryTypes';
import { BitMask64Utils } from '../Utils/BigIntCompatibility';
import { createLogger } from '../../Utils/Logger';