修复querysystem循环依赖的问题
This commit is contained in:
@@ -7,39 +7,9 @@ import { getComponentTypeName } from '../Decorators';
|
|||||||
import { Archetype, ArchetypeSystem } from './ArchetypeSystem';
|
import { Archetype, ArchetypeSystem } from './ArchetypeSystem';
|
||||||
import { ComponentTypeManager } from "../Utils";
|
import { ComponentTypeManager } from "../Utils";
|
||||||
import { ReactiveQuery, ReactiveQueryConfig } from './ReactiveQuery';
|
import { ReactiveQuery, ReactiveQueryConfig } from './ReactiveQuery';
|
||||||
|
import { QueryCondition, QueryConditionType, QueryResult } from './QueryTypes';
|
||||||
|
|
||||||
/**
|
export { QueryCondition, QueryConditionType, QueryResult };
|
||||||
* 查询条件类型
|
|
||||||
*/
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 实体索引结构
|
* 实体索引结构
|
||||||
|
|||||||
36
packages/core/src/ECS/Core/QueryTypes.ts
Normal file
36
packages/core/src/ECS/Core/QueryTypes.ts
Normal 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;
|
||||||
|
}
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
import { Entity } from '../Entity';
|
import { Entity } from '../Entity';
|
||||||
import { QueryCondition, QueryConditionType } from './QuerySystem';
|
import { QueryCondition, QueryConditionType } from './QueryTypes';
|
||||||
import { BitMask64Utils } from '../Utils/BigIntCompatibility';
|
import { BitMask64Utils } from '../Utils/BigIntCompatibility';
|
||||||
import { createLogger } from '../../Utils/Logger';
|
import { createLogger } from '../../Utils/Logger';
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user