@esengine/ecs-framework 2.1.29 → 2.1.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.cjs +1 -1
- package/index.cjs.map +1 -1
- package/index.d.ts +531 -736
- package/index.mjs +1 -1
- package/index.mjs.map +1 -1
- package/package.json +3 -2
- package/.npmignore +0 -40
- package/LICENSE +0 -201
- package/README.md +0 -465
- package/SECURITY.md +0 -53
package/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @esengine/ecs-framework v2.1.
|
|
2
|
+
* @esengine/ecs-framework v2.1.31
|
|
3
3
|
* TypeScript definitions
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
@@ -334,6 +334,7 @@ interface PoolStats {
|
|
|
334
334
|
/** 内存使用估算(字节) */
|
|
335
335
|
estimatedMemoryUsage: number;
|
|
336
336
|
}
|
|
337
|
+
|
|
337
338
|
/**
|
|
338
339
|
* 高性能通用对象池
|
|
339
340
|
* 支持任意类型的对象池化,包含详细的统计信息
|
|
@@ -366,145 +367,82 @@ declare class Pool<T extends IPoolable> {
|
|
|
366
367
|
*/
|
|
367
368
|
obtain(): T;
|
|
368
369
|
/**
|
|
369
|
-
*
|
|
370
|
-
* @param obj
|
|
370
|
+
* 释放对象回池中
|
|
371
|
+
* @param obj 要释放的对象
|
|
371
372
|
*/
|
|
372
|
-
|
|
373
|
+
release(obj: T): void;
|
|
373
374
|
/**
|
|
374
|
-
*
|
|
375
|
-
* @
|
|
375
|
+
* 获取池统计信息
|
|
376
|
+
* @returns 统计信息对象
|
|
376
377
|
*/
|
|
377
|
-
|
|
378
|
+
getStats(): Readonly<PoolStats>;
|
|
378
379
|
/**
|
|
379
380
|
* 清空池
|
|
380
381
|
*/
|
|
381
382
|
clear(): void;
|
|
382
383
|
/**
|
|
383
|
-
*
|
|
384
|
-
|
|
385
|
-
get size(): number;
|
|
386
|
-
/**
|
|
387
|
-
* 获取池的最大大小
|
|
388
|
-
*/
|
|
389
|
-
get maxSize(): number;
|
|
390
|
-
/**
|
|
391
|
-
* 设置池的最大大小
|
|
384
|
+
* 压缩池(移除多余的对象)
|
|
385
|
+
* @param targetSize 目标大小,默认为当前大小的一半
|
|
392
386
|
*/
|
|
393
|
-
|
|
387
|
+
compact(targetSize?: number): void;
|
|
394
388
|
/**
|
|
395
|
-
*
|
|
389
|
+
* 预填充池
|
|
390
|
+
* @param count 预填充的对象数量
|
|
396
391
|
*/
|
|
397
|
-
|
|
392
|
+
prewarm(count: number): void;
|
|
398
393
|
/**
|
|
399
|
-
*
|
|
394
|
+
* 设置最大池大小
|
|
395
|
+
* @param maxSize 新的最大大小
|
|
400
396
|
*/
|
|
401
|
-
|
|
397
|
+
setMaxSize(maxSize: number): void;
|
|
402
398
|
/**
|
|
403
|
-
*
|
|
399
|
+
* 获取池中可用对象数量
|
|
400
|
+
* @returns 可用对象数量
|
|
404
401
|
*/
|
|
405
|
-
|
|
402
|
+
getAvailableCount(): number;
|
|
406
403
|
/**
|
|
407
|
-
*
|
|
404
|
+
* 检查池是否为空
|
|
405
|
+
* @returns 如果池为空返回true
|
|
408
406
|
*/
|
|
409
|
-
|
|
407
|
+
isEmpty(): boolean;
|
|
410
408
|
/**
|
|
411
|
-
*
|
|
412
|
-
* @
|
|
413
|
-
* @returns 对象实例
|
|
409
|
+
* 检查池是否已满
|
|
410
|
+
* @returns 如果池已满返回true
|
|
414
411
|
*/
|
|
415
|
-
|
|
412
|
+
isFull(): boolean;
|
|
416
413
|
/**
|
|
417
|
-
*
|
|
418
|
-
* @
|
|
419
|
-
* @param obj 要归还的对象
|
|
414
|
+
* 获取所有已注册的池类型
|
|
415
|
+
* @returns 所有池类型的数组
|
|
420
416
|
*/
|
|
421
|
-
static
|
|
417
|
+
static getAllPoolTypes(): Function[];
|
|
422
418
|
/**
|
|
423
|
-
*
|
|
424
|
-
* @
|
|
425
|
-
* @param count 要创建的对象数量
|
|
419
|
+
* 获取所有池的统计信息
|
|
420
|
+
* @returns 包含所有池统计信息的对象
|
|
426
421
|
*/
|
|
427
|
-
static
|
|
422
|
+
static getAllPoolStats(): Record<string, PoolStats>;
|
|
428
423
|
/**
|
|
429
|
-
*
|
|
430
|
-
* @param type 对象类型
|
|
424
|
+
* 压缩所有池
|
|
431
425
|
*/
|
|
432
|
-
static
|
|
426
|
+
static compactAllPools(): void;
|
|
433
427
|
/**
|
|
434
|
-
*
|
|
428
|
+
* 清空所有池
|
|
435
429
|
*/
|
|
436
430
|
static clearAllPools(): void;
|
|
437
431
|
/**
|
|
438
|
-
*
|
|
439
|
-
* @returns
|
|
440
|
-
*/
|
|
441
|
-
static getStats(): {
|
|
442
|
-
[typeName: string]: PoolStats;
|
|
443
|
-
};
|
|
444
|
-
/**
|
|
445
|
-
* 静态方法:获取所有池的总内存使用量
|
|
446
|
-
* @returns 总内存使用量(字节)
|
|
447
|
-
*/
|
|
448
|
-
static getTotalMemoryUsage(): number;
|
|
449
|
-
/**
|
|
450
|
-
* 静态方法:获取性能报告
|
|
451
|
-
* @returns 格式化的性能报告
|
|
452
|
-
*/
|
|
453
|
-
static getPerformanceReport(): string;
|
|
454
|
-
}
|
|
455
|
-
/**
|
|
456
|
-
* 分层对象池
|
|
457
|
-
* 使用多个不同大小的池来优化内存使用
|
|
458
|
-
*/
|
|
459
|
-
declare class TieredObjectPool<T extends IPoolable> {
|
|
460
|
-
private pools;
|
|
461
|
-
private createFn;
|
|
462
|
-
private resetFn;
|
|
463
|
-
private tierSizes;
|
|
464
|
-
private totalObtained;
|
|
465
|
-
private totalReleased;
|
|
466
|
-
/**
|
|
467
|
-
* 构造函数
|
|
468
|
-
* @param createFn 创建对象的函数
|
|
469
|
-
* @param resetFn 重置对象的函数
|
|
470
|
-
* @param tierSizes 各层级的大小,默认[10, 50, 200]
|
|
471
|
-
* @param estimatedObjectSize 估算的单个对象大小
|
|
472
|
-
*/
|
|
473
|
-
constructor(createFn: () => T, resetFn: (obj: T) => void, tierSizes?: number[], estimatedObjectSize?: number);
|
|
474
|
-
/**
|
|
475
|
-
* 获取对象
|
|
476
|
-
* @returns 对象实例
|
|
477
|
-
*/
|
|
478
|
-
obtain(): T;
|
|
479
|
-
/**
|
|
480
|
-
* 释放对象
|
|
481
|
-
* @param obj 要释放的对象
|
|
482
|
-
*/
|
|
483
|
-
release(obj: T): void;
|
|
484
|
-
/**
|
|
485
|
-
* 预热所有池
|
|
486
|
-
* @param totalCount 总预热数量
|
|
487
|
-
*/
|
|
488
|
-
warmUp(totalCount: number): void;
|
|
489
|
-
/**
|
|
490
|
-
* 清空所有池
|
|
432
|
+
* 获取全局池统计信息的格式化字符串
|
|
433
|
+
* @returns 格式化的统计信息字符串
|
|
491
434
|
*/
|
|
492
|
-
|
|
435
|
+
static getGlobalStatsString(): string;
|
|
493
436
|
/**
|
|
494
|
-
*
|
|
437
|
+
* 更新命中率
|
|
495
438
|
*/
|
|
496
|
-
|
|
497
|
-
totalSize: number;
|
|
498
|
-
totalMaxSize: number;
|
|
499
|
-
totalMemoryUsage: number;
|
|
500
|
-
tierStats: PoolStats[];
|
|
501
|
-
hitRate: number;
|
|
502
|
-
};
|
|
439
|
+
private _updateHitRate;
|
|
503
440
|
/**
|
|
504
|
-
*
|
|
441
|
+
* 更新内存使用估算
|
|
505
442
|
*/
|
|
506
|
-
private
|
|
443
|
+
private _updateMemoryUsage;
|
|
507
444
|
}
|
|
445
|
+
|
|
508
446
|
/**
|
|
509
447
|
* 池管理器
|
|
510
448
|
* 统一管理所有对象池
|
|
@@ -520,29 +458,78 @@ declare class PoolManager {
|
|
|
520
458
|
* @param name 池名称
|
|
521
459
|
* @param pool 池实例
|
|
522
460
|
*/
|
|
523
|
-
registerPool<T extends IPoolable>(name: string, pool: Pool<T>
|
|
461
|
+
registerPool<T extends IPoolable>(name: string, pool: Pool<T>): void;
|
|
524
462
|
/**
|
|
525
463
|
* 获取池
|
|
526
464
|
* @param name 池名称
|
|
527
465
|
* @returns 池实例
|
|
528
466
|
*/
|
|
529
|
-
getPool<T extends IPoolable>(name: string): Pool<T> |
|
|
467
|
+
getPool<T extends IPoolable>(name: string): Pool<T> | null;
|
|
530
468
|
/**
|
|
531
469
|
* 更新池管理器(应在游戏循环中调用)
|
|
532
470
|
*/
|
|
533
471
|
update(): void;
|
|
534
472
|
/**
|
|
535
|
-
*
|
|
473
|
+
* 创建或获取标准池
|
|
474
|
+
* @param name 池名称
|
|
475
|
+
* @param createFn 创建函数
|
|
476
|
+
* @param maxSize 最大大小
|
|
477
|
+
* @param estimatedObjectSize 估算对象大小
|
|
478
|
+
* @returns 池实例
|
|
479
|
+
*/
|
|
480
|
+
createPool<T extends IPoolable>(name: string, createFn: () => T, maxSize?: number, estimatedObjectSize?: number): Pool<T>;
|
|
481
|
+
/**
|
|
482
|
+
* 移除池
|
|
483
|
+
* @param name 池名称
|
|
484
|
+
* @returns 是否成功移除
|
|
485
|
+
*/
|
|
486
|
+
removePool(name: string): boolean;
|
|
487
|
+
/**
|
|
488
|
+
* 获取所有池名称
|
|
489
|
+
* @returns 池名称数组
|
|
490
|
+
*/
|
|
491
|
+
getPoolNames(): string[];
|
|
492
|
+
/**
|
|
493
|
+
* 获取池数量
|
|
494
|
+
* @returns 池数量
|
|
495
|
+
*/
|
|
496
|
+
getPoolCount(): number;
|
|
497
|
+
/**
|
|
498
|
+
* 压缩所有池
|
|
536
499
|
*/
|
|
537
500
|
compactAllPools(): void;
|
|
501
|
+
/**
|
|
502
|
+
* 清空所有池
|
|
503
|
+
*/
|
|
504
|
+
clearAllPools(): void;
|
|
538
505
|
/**
|
|
539
506
|
* 获取所有池的统计信息
|
|
507
|
+
* @returns 统计信息映射
|
|
540
508
|
*/
|
|
541
|
-
getAllStats(): Map<string,
|
|
509
|
+
getAllStats(): Map<string, PoolStats>;
|
|
510
|
+
/**
|
|
511
|
+
* 获取总体统计信息
|
|
512
|
+
* @returns 总体统计信息
|
|
513
|
+
*/
|
|
514
|
+
getGlobalStats(): PoolStats;
|
|
515
|
+
/**
|
|
516
|
+
* 获取格式化的统计信息字符串
|
|
517
|
+
* @returns 格式化字符串
|
|
518
|
+
*/
|
|
519
|
+
getStatsString(): string;
|
|
520
|
+
/**
|
|
521
|
+
* 设置自动压缩间隔
|
|
522
|
+
* @param intervalMs 间隔毫秒数
|
|
523
|
+
*/
|
|
524
|
+
setAutoCompactInterval(intervalMs: number): void;
|
|
525
|
+
/**
|
|
526
|
+
* 预填充所有池
|
|
527
|
+
*/
|
|
528
|
+
prewarmAllPools(): void;
|
|
542
529
|
/**
|
|
543
|
-
*
|
|
530
|
+
* 重置池管理器
|
|
544
531
|
*/
|
|
545
|
-
|
|
532
|
+
reset(): void;
|
|
546
533
|
}
|
|
547
534
|
|
|
548
535
|
/**
|
|
@@ -1294,6 +1281,7 @@ interface EventBatchConfig {
|
|
|
1294
1281
|
* 支持同步/异步事件、优先级、批处理等功能
|
|
1295
1282
|
*/
|
|
1296
1283
|
declare class TypeSafeEventSystem {
|
|
1284
|
+
private static readonly _logger;
|
|
1297
1285
|
private listeners;
|
|
1298
1286
|
private stats;
|
|
1299
1287
|
private batchQueue;
|
|
@@ -1460,6 +1448,162 @@ declare class TypeSafeEventSystem {
|
|
|
1460
1448
|
private createEmptyStats;
|
|
1461
1449
|
}
|
|
1462
1450
|
|
|
1451
|
+
/**
|
|
1452
|
+
* 日志级别
|
|
1453
|
+
*/
|
|
1454
|
+
declare enum LogLevel {
|
|
1455
|
+
Debug = 0,
|
|
1456
|
+
Info = 1,
|
|
1457
|
+
Warn = 2,
|
|
1458
|
+
Error = 3,
|
|
1459
|
+
Fatal = 4,
|
|
1460
|
+
None = 5
|
|
1461
|
+
}
|
|
1462
|
+
/**
|
|
1463
|
+
* 日志接口
|
|
1464
|
+
*/
|
|
1465
|
+
interface ILogger {
|
|
1466
|
+
debug(message: string, ...args: unknown[]): void;
|
|
1467
|
+
info(message: string, ...args: unknown[]): void;
|
|
1468
|
+
warn(message: string, ...args: unknown[]): void;
|
|
1469
|
+
error(message: string, ...args: unknown[]): void;
|
|
1470
|
+
fatal(message: string, ...args: unknown[]): void;
|
|
1471
|
+
}
|
|
1472
|
+
/**
|
|
1473
|
+
* 日志配置
|
|
1474
|
+
*/
|
|
1475
|
+
interface LoggerConfig {
|
|
1476
|
+
/** 日志级别 */
|
|
1477
|
+
level: LogLevel;
|
|
1478
|
+
/** 是否启用时间戳 */
|
|
1479
|
+
enableTimestamp: boolean;
|
|
1480
|
+
/** 是否启用颜色 */
|
|
1481
|
+
enableColors: boolean;
|
|
1482
|
+
/** 日志前缀 */
|
|
1483
|
+
prefix?: string;
|
|
1484
|
+
/** 自定义输出函数 */
|
|
1485
|
+
output?: (level: LogLevel, message: string) => void;
|
|
1486
|
+
}
|
|
1487
|
+
/**
|
|
1488
|
+
* 默认控制台日志实现
|
|
1489
|
+
*/
|
|
1490
|
+
declare class ConsoleLogger implements ILogger {
|
|
1491
|
+
private _config;
|
|
1492
|
+
constructor(config?: Partial<LoggerConfig>);
|
|
1493
|
+
/**
|
|
1494
|
+
* 输出调试级别日志
|
|
1495
|
+
* @param message 日志消息
|
|
1496
|
+
* @param args 附加参数
|
|
1497
|
+
*/
|
|
1498
|
+
debug(message: string, ...args: unknown[]): void;
|
|
1499
|
+
/**
|
|
1500
|
+
* 输出信息级别日志
|
|
1501
|
+
* @param message 日志消息
|
|
1502
|
+
* @param args 附加参数
|
|
1503
|
+
*/
|
|
1504
|
+
info(message: string, ...args: unknown[]): void;
|
|
1505
|
+
/**
|
|
1506
|
+
* 输出警告级别日志
|
|
1507
|
+
* @param message 日志消息
|
|
1508
|
+
* @param args 附加参数
|
|
1509
|
+
*/
|
|
1510
|
+
warn(message: string, ...args: unknown[]): void;
|
|
1511
|
+
/**
|
|
1512
|
+
* 输出错误级别日志
|
|
1513
|
+
* @param message 日志消息
|
|
1514
|
+
* @param args 附加参数
|
|
1515
|
+
*/
|
|
1516
|
+
error(message: string, ...args: unknown[]): void;
|
|
1517
|
+
/**
|
|
1518
|
+
* 输出致命错误级别日志
|
|
1519
|
+
* @param message 日志消息
|
|
1520
|
+
* @param args 附加参数
|
|
1521
|
+
*/
|
|
1522
|
+
fatal(message: string, ...args: unknown[]): void;
|
|
1523
|
+
/**
|
|
1524
|
+
* 设置日志级别
|
|
1525
|
+
* @param level 日志级别
|
|
1526
|
+
*/
|
|
1527
|
+
setLevel(level: LogLevel): void;
|
|
1528
|
+
/**
|
|
1529
|
+
* 设置日志前缀
|
|
1530
|
+
* @param prefix 前缀字符串
|
|
1531
|
+
*/
|
|
1532
|
+
setPrefix(prefix: string): void;
|
|
1533
|
+
/**
|
|
1534
|
+
* 内部日志输出方法
|
|
1535
|
+
* @param level 日志级别
|
|
1536
|
+
* @param message 日志消息
|
|
1537
|
+
* @param args 附加参数
|
|
1538
|
+
*/
|
|
1539
|
+
private log;
|
|
1540
|
+
/**
|
|
1541
|
+
* 输出到控制台
|
|
1542
|
+
* @param level 日志级别
|
|
1543
|
+
* @param message 格式化后的消息
|
|
1544
|
+
* @param args 附加参数
|
|
1545
|
+
*/
|
|
1546
|
+
private outputToConsole;
|
|
1547
|
+
/**
|
|
1548
|
+
* 获取控制台颜色配置
|
|
1549
|
+
* @returns 颜色配置对象
|
|
1550
|
+
*/
|
|
1551
|
+
private getColors;
|
|
1552
|
+
}
|
|
1553
|
+
/**
|
|
1554
|
+
* 日志管理器
|
|
1555
|
+
*/
|
|
1556
|
+
declare class LoggerManager {
|
|
1557
|
+
private static _instance;
|
|
1558
|
+
private _loggers;
|
|
1559
|
+
private _defaultLogger;
|
|
1560
|
+
private constructor();
|
|
1561
|
+
/**
|
|
1562
|
+
* 获取日志管理器实例
|
|
1563
|
+
* @returns 日志管理器实例
|
|
1564
|
+
*/
|
|
1565
|
+
static getInstance(): LoggerManager;
|
|
1566
|
+
/**
|
|
1567
|
+
* 获取或创建日志器
|
|
1568
|
+
* @param name 日志器名称
|
|
1569
|
+
* @returns 日志器实例
|
|
1570
|
+
*/
|
|
1571
|
+
getLogger(name?: string): ILogger;
|
|
1572
|
+
/**
|
|
1573
|
+
* 设置日志器
|
|
1574
|
+
* @param name 日志器名称
|
|
1575
|
+
* @param logger 日志器实例
|
|
1576
|
+
*/
|
|
1577
|
+
setLogger(name: string, logger: ILogger): void;
|
|
1578
|
+
/**
|
|
1579
|
+
* 设置全局日志级别
|
|
1580
|
+
* @param level 日志级别
|
|
1581
|
+
*/
|
|
1582
|
+
setGlobalLevel(level: LogLevel): void;
|
|
1583
|
+
/**
|
|
1584
|
+
* 创建子日志器
|
|
1585
|
+
* @param parentName 父日志器名称
|
|
1586
|
+
* @param childName 子日志器名称
|
|
1587
|
+
* @returns 子日志器实例
|
|
1588
|
+
*/
|
|
1589
|
+
createChildLogger(parentName: string, childName: string): ILogger;
|
|
1590
|
+
}
|
|
1591
|
+
/**
|
|
1592
|
+
* 默认日志器实例
|
|
1593
|
+
*/
|
|
1594
|
+
declare const Logger: ILogger;
|
|
1595
|
+
/**
|
|
1596
|
+
* 创建命名日志器
|
|
1597
|
+
* @param name 日志器名称
|
|
1598
|
+
* @returns 日志器实例
|
|
1599
|
+
*/
|
|
1600
|
+
declare function createLogger(name: string): ILogger;
|
|
1601
|
+
/**
|
|
1602
|
+
* 设置全局日志级别
|
|
1603
|
+
* @param level 日志级别
|
|
1604
|
+
*/
|
|
1605
|
+
declare function setGlobalLogLevel(level: LogLevel): void;
|
|
1606
|
+
|
|
1463
1607
|
/**
|
|
1464
1608
|
* BigInt兼容性抽象层
|
|
1465
1609
|
*
|
|
@@ -1548,6 +1692,70 @@ interface IBigIntLike {
|
|
|
1548
1692
|
*/
|
|
1549
1693
|
clone(): IBigIntLike;
|
|
1550
1694
|
}
|
|
1695
|
+
/**
|
|
1696
|
+
* BigInt工厂类
|
|
1697
|
+
*
|
|
1698
|
+
* 自动检测运行时环境的BigInt支持情况,并提供统一的创建接口。
|
|
1699
|
+
* 在支持BigInt的环境中使用原生实现,在不支持的环境中使用兼容实现。
|
|
1700
|
+
*/
|
|
1701
|
+
declare class BigIntFactory {
|
|
1702
|
+
private static _supportsBigInt;
|
|
1703
|
+
private static _cachedZero;
|
|
1704
|
+
private static _cachedOne;
|
|
1705
|
+
/**
|
|
1706
|
+
* 检查是否支持原生BigInt
|
|
1707
|
+
* @returns 是否支持原生BigInt
|
|
1708
|
+
*/
|
|
1709
|
+
static isNativeSupported(): boolean;
|
|
1710
|
+
/**
|
|
1711
|
+
* 检测BigInt支持情况
|
|
1712
|
+
* @returns 是否支持BigInt
|
|
1713
|
+
*/
|
|
1714
|
+
private static detectBigIntSupport;
|
|
1715
|
+
/**
|
|
1716
|
+
* 创建BigInt兼容值
|
|
1717
|
+
* @param value 初始值
|
|
1718
|
+
* @returns IBigIntLike实例
|
|
1719
|
+
*/
|
|
1720
|
+
static create(value?: number | string | bigint): IBigIntLike;
|
|
1721
|
+
/**
|
|
1722
|
+
* 创建零值
|
|
1723
|
+
* @returns 零值的IBigIntLike实例
|
|
1724
|
+
*/
|
|
1725
|
+
static zero(): IBigIntLike;
|
|
1726
|
+
/**
|
|
1727
|
+
* 创建1值
|
|
1728
|
+
* @returns 1值的IBigIntLike实例
|
|
1729
|
+
*/
|
|
1730
|
+
static one(): IBigIntLike;
|
|
1731
|
+
/**
|
|
1732
|
+
* 从二进制字符串创建
|
|
1733
|
+
* @param binary 二进制字符串
|
|
1734
|
+
* @returns IBigIntLike实例
|
|
1735
|
+
*/
|
|
1736
|
+
static fromBinaryString(binary: string): IBigIntLike;
|
|
1737
|
+
/**
|
|
1738
|
+
* 从十六进制字符串创建
|
|
1739
|
+
* @param hex 十六进制字符串
|
|
1740
|
+
* @returns IBigIntLike实例
|
|
1741
|
+
*/
|
|
1742
|
+
static fromHexString(hex: string): IBigIntLike;
|
|
1743
|
+
/**
|
|
1744
|
+
* 获取环境信息
|
|
1745
|
+
* @returns 环境信息对象
|
|
1746
|
+
*/
|
|
1747
|
+
static getEnvironmentInfo(): EnvironmentInfo;
|
|
1748
|
+
/**
|
|
1749
|
+
* 检测运行环境
|
|
1750
|
+
* @returns 环境类型
|
|
1751
|
+
*/
|
|
1752
|
+
private static detectEnvironment;
|
|
1753
|
+
/**
|
|
1754
|
+
* 检测JavaScript引擎
|
|
1755
|
+
* @returns JS引擎信息
|
|
1756
|
+
*/
|
|
1757
|
+
private static detectJSEngine;
|
|
1758
|
+
}
|
|
1551
1759
|
/**
|
|
1552
1760
|
* 环境信息接口
|
|
1553
1761
|
*/
|
|
@@ -1560,11 +1768,42 @@ interface EnvironmentInfo {
|
|
|
1560
1768
|
jsEngine: string;
|
|
1561
1769
|
}
|
|
1562
1770
|
|
|
1771
|
+
/**
|
|
1772
|
+
* 启用SoA优化装饰器
|
|
1773
|
+
* 默认关闭SoA,只有在大规模批量操作场景下才建议开启
|
|
1774
|
+
*/
|
|
1775
|
+
declare function EnableSoA<T extends ComponentType>(target: T): T;
|
|
1776
|
+
/**
|
|
1777
|
+
* 高精度数值装饰器
|
|
1778
|
+
* 标记字段需要保持完整精度,存储为复杂对象而非TypedArray
|
|
1779
|
+
*/
|
|
1780
|
+
declare function HighPrecision(target: any, propertyKey: string | symbol): void;
|
|
1781
|
+
/**
|
|
1782
|
+
* 64位浮点数装饰器
|
|
1783
|
+
* 标记字段使用Float64Array存储(更高精度但更多内存)
|
|
1784
|
+
*/
|
|
1785
|
+
declare function Float64(target: any, propertyKey: string | symbol): void;
|
|
1786
|
+
/**
|
|
1787
|
+
* 32位浮点数装饰器
|
|
1788
|
+
* 标记字段使用Float32Array存储(默认类型,平衡性能和精度)
|
|
1789
|
+
*/
|
|
1790
|
+
declare function Float32(target: any, propertyKey: string | symbol): void;
|
|
1791
|
+
/**
|
|
1792
|
+
* 32位整数装饰器
|
|
1793
|
+
* 标记字段使用Int32Array存储(适用于整数值)
|
|
1794
|
+
*/
|
|
1795
|
+
declare function Int32(target: any, propertyKey: string | symbol): void;
|
|
1796
|
+
/**
|
|
1797
|
+
* 序列化Map装饰器
|
|
1798
|
+
* 标记Map字段需要序列化/反序列化存储
|
|
1799
|
+
*/
|
|
1800
|
+
declare function SerializeMap(target: any, propertyKey: string | symbol): void;
|
|
1563
1801
|
/**
|
|
1564
1802
|
* SoA存储器(需要装饰器启用)
|
|
1565
1803
|
* 使用Structure of Arrays存储模式,在大规模批量操作时提供优异性能
|
|
1566
1804
|
*/
|
|
1567
1805
|
declare class SoAStorage<T extends Component> {
|
|
1806
|
+
private static readonly _logger;
|
|
1568
1807
|
private fields;
|
|
1569
1808
|
private stringFields;
|
|
1570
1809
|
private serializedFields;
|
|
@@ -1613,6 +1852,91 @@ declare class SoAStorage<T extends Component> {
|
|
|
1613
1852
|
* 组件类型定义
|
|
1614
1853
|
*/
|
|
1615
1854
|
type ComponentType<T extends Component = Component> = new (...args: unknown[]) => T;
|
|
1855
|
+
/**
|
|
1856
|
+
* 组件注册表
|
|
1857
|
+
* 管理组件类型的位掩码分配
|
|
1858
|
+
*/
|
|
1859
|
+
declare class ComponentRegistry {
|
|
1860
|
+
protected static readonly _logger: ILogger;
|
|
1861
|
+
private static componentTypes;
|
|
1862
|
+
private static componentNameToType;
|
|
1863
|
+
private static componentNameToId;
|
|
1864
|
+
private static maskCache;
|
|
1865
|
+
private static nextBitIndex;
|
|
1866
|
+
private static maxComponents;
|
|
1867
|
+
/**
|
|
1868
|
+
* 注册组件类型并分配位掩码
|
|
1869
|
+
* @param componentType 组件类型
|
|
1870
|
+
* @returns 分配的位索引
|
|
1871
|
+
*/
|
|
1872
|
+
static register<T extends Component>(componentType: ComponentType<T>): number;
|
|
1873
|
+
/**
|
|
1874
|
+
* 获取组件类型的位掩码
|
|
1875
|
+
* @param componentType 组件类型
|
|
1876
|
+
* @returns 位掩码
|
|
1877
|
+
*/
|
|
1878
|
+
static getBitMask<T extends Component>(componentType: ComponentType<T>): IBigIntLike;
|
|
1879
|
+
/**
|
|
1880
|
+
* 获取组件类型的位索引
|
|
1881
|
+
* @param componentType 组件类型
|
|
1882
|
+
* @returns 位索引
|
|
1883
|
+
*/
|
|
1884
|
+
static getBitIndex<T extends Component>(componentType: ComponentType<T>): number;
|
|
1885
|
+
/**
|
|
1886
|
+
* 检查组件类型是否已注册
|
|
1887
|
+
* @param componentType 组件类型
|
|
1888
|
+
* @returns 是否已注册
|
|
1889
|
+
*/
|
|
1890
|
+
static isRegistered<T extends Component>(componentType: ComponentType<T>): boolean;
|
|
1891
|
+
/**
|
|
1892
|
+
* 通过名称获取组件类型
|
|
1893
|
+
* @param componentName 组件名称
|
|
1894
|
+
* @returns 组件类型构造函数
|
|
1895
|
+
*/
|
|
1896
|
+
static getComponentType(componentName: string): Function | null;
|
|
1897
|
+
/**
|
|
1898
|
+
* 获取所有已注册的组件类型
|
|
1899
|
+
* @returns 组件类型映射
|
|
1900
|
+
*/
|
|
1901
|
+
static getAllRegisteredTypes(): Map<Function, number>;
|
|
1902
|
+
/**
|
|
1903
|
+
* 获取所有组件名称到类型的映射
|
|
1904
|
+
* @returns 名称到类型的映射
|
|
1905
|
+
*/
|
|
1906
|
+
static getAllComponentNames(): Map<string, Function>;
|
|
1907
|
+
/**
|
|
1908
|
+
* 通过名称获取组件类型ID
|
|
1909
|
+
* @param componentName 组件名称
|
|
1910
|
+
* @returns 组件类型ID
|
|
1911
|
+
*/
|
|
1912
|
+
static getComponentId(componentName: string): number | undefined;
|
|
1913
|
+
/**
|
|
1914
|
+
* 注册组件类型(通过名称)
|
|
1915
|
+
* @param componentName 组件名称
|
|
1916
|
+
* @returns 分配的组件ID
|
|
1917
|
+
*/
|
|
1918
|
+
static registerComponentByName(componentName: string): number;
|
|
1919
|
+
/**
|
|
1920
|
+
* 创建单个组件的掩码
|
|
1921
|
+
* @param componentName 组件名称
|
|
1922
|
+
* @returns 组件掩码
|
|
1923
|
+
*/
|
|
1924
|
+
static createSingleComponentMask(componentName: string): IBigIntLike;
|
|
1925
|
+
/**
|
|
1926
|
+
* 创建多个组件的掩码
|
|
1927
|
+
* @param componentNames 组件名称数组
|
|
1928
|
+
* @returns 组合掩码
|
|
1929
|
+
*/
|
|
1930
|
+
static createComponentMask(componentNames: string[]): IBigIntLike;
|
|
1931
|
+
/**
|
|
1932
|
+
* 清除掩码缓存
|
|
1933
|
+
*/
|
|
1934
|
+
static clearMaskCache(): void;
|
|
1935
|
+
/**
|
|
1936
|
+
* 重置注册表(用于测试)
|
|
1937
|
+
*/
|
|
1938
|
+
static reset(): void;
|
|
1939
|
+
}
|
|
1616
1940
|
/**
|
|
1617
1941
|
* 高性能组件存储器
|
|
1618
1942
|
* 使用SoA(Structure of Arrays)模式存储组件
|
|
@@ -1693,6 +2017,7 @@ declare class ComponentStorage<T extends Component> {
|
|
|
1693
2017
|
* 管理所有组件类型的存储器
|
|
1694
2018
|
*/
|
|
1695
2019
|
declare class ComponentStorageManager {
|
|
2020
|
+
private static readonly _logger;
|
|
1696
2021
|
private storages;
|
|
1697
2022
|
/**
|
|
1698
2023
|
* 获取或创建组件存储器(默认原始存储)
|
|
@@ -2032,6 +2357,7 @@ interface QueryResult {
|
|
|
2032
2357
|
* ```
|
|
2033
2358
|
*/
|
|
2034
2359
|
declare class QuerySystem {
|
|
2360
|
+
private _logger;
|
|
2035
2361
|
private entities;
|
|
2036
2362
|
private entityIndex;
|
|
2037
2363
|
private indexDirty;
|
|
@@ -2040,8 +2366,6 @@ declare class QuerySystem {
|
|
|
2040
2366
|
private cacheMaxSize;
|
|
2041
2367
|
private cacheTimeout;
|
|
2042
2368
|
private componentPoolManager;
|
|
2043
|
-
private bitMaskOptimizer;
|
|
2044
|
-
private indexUpdateBatcher;
|
|
2045
2369
|
private componentIndexManager;
|
|
2046
2370
|
private archetypeSystem;
|
|
2047
2371
|
private dirtyTrackingSystem;
|
|
@@ -2120,7 +2444,7 @@ declare class QuerySystem {
|
|
|
2120
2444
|
* ```typescript
|
|
2121
2445
|
* // 查询同时具有位置和速度组件的实体
|
|
2122
2446
|
* const result = querySystem.queryAll(PositionComponent, VelocityComponent);
|
|
2123
|
-
*
|
|
2447
|
+
* logger.info(`找到 ${result.count} 个移动实体`);
|
|
2124
2448
|
* ```
|
|
2125
2449
|
*/
|
|
2126
2450
|
queryAll(...componentTypes: ComponentType[]): QueryResult;
|
|
@@ -2147,7 +2471,7 @@ declare class QuerySystem {
|
|
|
2147
2471
|
* ```typescript
|
|
2148
2472
|
* // 查询具有武器或护甲组件的实体
|
|
2149
2473
|
* const result = querySystem.queryAny(WeaponComponent, ArmorComponent);
|
|
2150
|
-
*
|
|
2474
|
+
* logger.info(`找到 ${result.count} 个装备实体`);
|
|
2151
2475
|
* ```
|
|
2152
2476
|
*/
|
|
2153
2477
|
queryAny(...componentTypes: ComponentType[]): QueryResult;
|
|
@@ -2164,7 +2488,7 @@ declare class QuerySystem {
|
|
|
2164
2488
|
* ```typescript
|
|
2165
2489
|
* // 查询不具有AI和玩家控制组件的实体(如静态物体)
|
|
2166
2490
|
* const result = querySystem.queryNone(AIComponent, PlayerControlComponent);
|
|
2167
|
-
*
|
|
2491
|
+
* logger.info(`找到 ${result.count} 个静态实体`);
|
|
2168
2492
|
* ```
|
|
2169
2493
|
*/
|
|
2170
2494
|
queryNone(...componentTypes: ComponentType[]): QueryResult;
|
|
@@ -2366,6 +2690,7 @@ declare class QuerySystem {
|
|
|
2366
2690
|
* ```
|
|
2367
2691
|
*/
|
|
2368
2692
|
declare class QueryBuilder {
|
|
2693
|
+
private _logger;
|
|
2369
2694
|
private conditions;
|
|
2370
2695
|
private querySystem;
|
|
2371
2696
|
constructor(querySystem: QuerySystem);
|
|
@@ -2417,6 +2742,7 @@ declare class QueryBuilder {
|
|
|
2417
2742
|
* 基于TypeSafeEventSystem,提供类型安全的事件发布订阅机制
|
|
2418
2743
|
*/
|
|
2419
2744
|
declare class EventBus implements IEventBus {
|
|
2745
|
+
private static readonly _logger;
|
|
2420
2746
|
private eventSystem;
|
|
2421
2747
|
private eventIdCounter;
|
|
2422
2748
|
private isDebugMode;
|
|
@@ -2680,6 +3006,10 @@ declare class EntityComparer {
|
|
|
2680
3006
|
* ```
|
|
2681
3007
|
*/
|
|
2682
3008
|
declare class Entity {
|
|
3009
|
+
/**
|
|
3010
|
+
* Entity专用日志器
|
|
3011
|
+
*/
|
|
3012
|
+
private static _logger;
|
|
2683
3013
|
/**
|
|
2684
3014
|
* 实体比较器实例
|
|
2685
3015
|
*/
|
|
@@ -3416,6 +3746,7 @@ declare abstract class EntitySystem implements ISystemBase {
|
|
|
3416
3746
|
* 管理场景中的所有实体系统
|
|
3417
3747
|
*/
|
|
3418
3748
|
declare class EntityProcessorList {
|
|
3749
|
+
private static readonly _logger;
|
|
3419
3750
|
private _processors;
|
|
3420
3751
|
private _isDirty;
|
|
3421
3752
|
/**
|
|
@@ -3990,6 +4321,7 @@ declare class EntityBuilder {
|
|
|
3990
4321
|
*/
|
|
3991
4322
|
clone(): EntityBuilder;
|
|
3992
4323
|
}
|
|
4324
|
+
|
|
3993
4325
|
/**
|
|
3994
4326
|
* 场景构建器 - 提供流式API创建和配置场景
|
|
3995
4327
|
*/
|
|
@@ -4038,6 +4370,7 @@ declare class SceneBuilder {
|
|
|
4038
4370
|
*/
|
|
4039
4371
|
build(): Scene;
|
|
4040
4372
|
}
|
|
4373
|
+
|
|
4041
4374
|
/**
|
|
4042
4375
|
* 组件构建器 - 提供流式API创建组件
|
|
4043
4376
|
*/
|
|
@@ -4071,30 +4404,86 @@ declare class ComponentBuilder<T extends Component> {
|
|
|
4071
4404
|
*/
|
|
4072
4405
|
build(): T;
|
|
4073
4406
|
}
|
|
4407
|
+
|
|
4074
4408
|
/**
|
|
4075
|
-
*
|
|
4076
|
-
*
|
|
4409
|
+
* 实体批量操作器
|
|
4410
|
+
* 提供对多个实体的批量操作
|
|
4077
4411
|
*/
|
|
4078
|
-
declare class
|
|
4079
|
-
private
|
|
4080
|
-
|
|
4081
|
-
private eventSystem;
|
|
4082
|
-
constructor(scene: Scene, querySystem: QuerySystem, eventSystem: TypeSafeEventSystem);
|
|
4412
|
+
declare class EntityBatchOperator {
|
|
4413
|
+
private entities;
|
|
4414
|
+
constructor(entities: Entity[]);
|
|
4083
4415
|
/**
|
|
4084
|
-
*
|
|
4085
|
-
* @
|
|
4416
|
+
* 批量添加组件
|
|
4417
|
+
* @param component 组件实例
|
|
4418
|
+
* @returns 批量操作器
|
|
4086
4419
|
*/
|
|
4087
|
-
|
|
4420
|
+
addComponent<T extends Component>(component: T): EntityBatchOperator;
|
|
4088
4421
|
/**
|
|
4089
|
-
*
|
|
4090
|
-
* @
|
|
4422
|
+
* 批量移除组件
|
|
4423
|
+
* @param componentType 组件类型
|
|
4424
|
+
* @returns 批量操作器
|
|
4091
4425
|
*/
|
|
4092
|
-
|
|
4426
|
+
removeComponent<T extends Component>(componentType: ComponentType<T>): EntityBatchOperator;
|
|
4093
4427
|
/**
|
|
4094
|
-
*
|
|
4095
|
-
* @param
|
|
4096
|
-
* @
|
|
4097
|
-
|
|
4428
|
+
* 批量设置活跃状态
|
|
4429
|
+
* @param active 是否活跃
|
|
4430
|
+
* @returns 批量操作器
|
|
4431
|
+
*/
|
|
4432
|
+
setActive(active: boolean): EntityBatchOperator;
|
|
4433
|
+
/**
|
|
4434
|
+
* 批量设置标签
|
|
4435
|
+
* @param tag 标签
|
|
4436
|
+
* @returns 批量操作器
|
|
4437
|
+
*/
|
|
4438
|
+
setTag(tag: number): EntityBatchOperator;
|
|
4439
|
+
/**
|
|
4440
|
+
* 批量执行操作
|
|
4441
|
+
* @param operation 操作函数
|
|
4442
|
+
* @returns 批量操作器
|
|
4443
|
+
*/
|
|
4444
|
+
forEach(operation: (entity: Entity, index: number) => void): EntityBatchOperator;
|
|
4445
|
+
/**
|
|
4446
|
+
* 过滤实体
|
|
4447
|
+
* @param predicate 过滤条件
|
|
4448
|
+
* @returns 新的批量操作器
|
|
4449
|
+
*/
|
|
4450
|
+
filter(predicate: (entity: Entity) => boolean): EntityBatchOperator;
|
|
4451
|
+
/**
|
|
4452
|
+
* 获取实体数组
|
|
4453
|
+
* @returns 实体数组
|
|
4454
|
+
*/
|
|
4455
|
+
toArray(): Entity[];
|
|
4456
|
+
/**
|
|
4457
|
+
* 获取实体数量
|
|
4458
|
+
* @returns 实体数量
|
|
4459
|
+
*/
|
|
4460
|
+
count(): number;
|
|
4461
|
+
}
|
|
4462
|
+
|
|
4463
|
+
/**
|
|
4464
|
+
* ECS流式API主入口
|
|
4465
|
+
* 提供统一的流式接口
|
|
4466
|
+
*/
|
|
4467
|
+
declare class ECSFluentAPI {
|
|
4468
|
+
private scene;
|
|
4469
|
+
private querySystem;
|
|
4470
|
+
private eventSystem;
|
|
4471
|
+
constructor(scene: Scene, querySystem: QuerySystem, eventSystem: TypeSafeEventSystem);
|
|
4472
|
+
/**
|
|
4473
|
+
* 创建实体构建器
|
|
4474
|
+
* @returns 实体构建器
|
|
4475
|
+
*/
|
|
4476
|
+
createEntity(): EntityBuilder;
|
|
4477
|
+
/**
|
|
4478
|
+
* 创建场景构建器
|
|
4479
|
+
* @returns 场景构建器
|
|
4480
|
+
*/
|
|
4481
|
+
createScene(): SceneBuilder;
|
|
4482
|
+
/**
|
|
4483
|
+
* 创建组件构建器
|
|
4484
|
+
* @param componentClass 组件类
|
|
4485
|
+
* @param args 构造参数
|
|
4486
|
+
* @returns 组件构建器
|
|
4098
4487
|
*/
|
|
4099
4488
|
createComponent<T extends Component>(componentClass: new (...args: unknown[]) => T, ...args: unknown[]): ComponentBuilder<T>;
|
|
4100
4489
|
/**
|
|
@@ -4176,60 +4565,6 @@ declare class ECSFluentAPI {
|
|
|
4176
4565
|
eventStats: Map<string, any>;
|
|
4177
4566
|
};
|
|
4178
4567
|
}
|
|
4179
|
-
/**
|
|
4180
|
-
* 实体批量操作器
|
|
4181
|
-
* 提供对多个实体的批量操作
|
|
4182
|
-
*/
|
|
4183
|
-
declare class EntityBatchOperator {
|
|
4184
|
-
private entities;
|
|
4185
|
-
constructor(entities: Entity[]);
|
|
4186
|
-
/**
|
|
4187
|
-
* 批量添加组件
|
|
4188
|
-
* @param component 组件实例
|
|
4189
|
-
* @returns 批量操作器
|
|
4190
|
-
*/
|
|
4191
|
-
addComponent<T extends Component>(component: T): EntityBatchOperator;
|
|
4192
|
-
/**
|
|
4193
|
-
* 批量移除组件
|
|
4194
|
-
* @param componentType 组件类型
|
|
4195
|
-
* @returns 批量操作器
|
|
4196
|
-
*/
|
|
4197
|
-
removeComponent<T extends Component>(componentType: ComponentType<T>): EntityBatchOperator;
|
|
4198
|
-
/**
|
|
4199
|
-
* 批量设置活跃状态
|
|
4200
|
-
* @param active 是否活跃
|
|
4201
|
-
* @returns 批量操作器
|
|
4202
|
-
*/
|
|
4203
|
-
setActive(active: boolean): EntityBatchOperator;
|
|
4204
|
-
/**
|
|
4205
|
-
* 批量设置标签
|
|
4206
|
-
* @param tag 标签
|
|
4207
|
-
* @returns 批量操作器
|
|
4208
|
-
*/
|
|
4209
|
-
setTag(tag: number): EntityBatchOperator;
|
|
4210
|
-
/**
|
|
4211
|
-
* 批量执行操作
|
|
4212
|
-
* @param operation 操作函数
|
|
4213
|
-
* @returns 批量操作器
|
|
4214
|
-
*/
|
|
4215
|
-
forEach(operation: (entity: Entity, index: number) => void): EntityBatchOperator;
|
|
4216
|
-
/**
|
|
4217
|
-
* 过滤实体
|
|
4218
|
-
* @param predicate 过滤条件
|
|
4219
|
-
* @returns 新的批量操作器
|
|
4220
|
-
*/
|
|
4221
|
-
filter(predicate: (entity: Entity) => boolean): EntityBatchOperator;
|
|
4222
|
-
/**
|
|
4223
|
-
* 获取实体数组
|
|
4224
|
-
* @returns 实体数组
|
|
4225
|
-
*/
|
|
4226
|
-
toArray(): Entity[];
|
|
4227
|
-
/**
|
|
4228
|
-
* 获取实体数量
|
|
4229
|
-
* @returns 实体数量
|
|
4230
|
-
*/
|
|
4231
|
-
count(): number;
|
|
4232
|
-
}
|
|
4233
4568
|
/**
|
|
4234
4569
|
* 创建ECS流式API实例
|
|
4235
4570
|
* @param scene 场景
|
|
@@ -4595,7 +4930,7 @@ declare class DebugManager {
|
|
|
4595
4930
|
*
|
|
4596
4931
|
* // 调度定时器
|
|
4597
4932
|
* Core.schedule(1.0, false, null, (timer) => {
|
|
4598
|
-
*
|
|
4933
|
+
* Core._logger.info("1秒后执行");
|
|
4599
4934
|
* });
|
|
4600
4935
|
* ```
|
|
4601
4936
|
*/
|
|
@@ -4610,6 +4945,10 @@ declare class Core {
|
|
|
4610
4945
|
* 全局核心实例
|
|
4611
4946
|
*/
|
|
4612
4947
|
private static _instance;
|
|
4948
|
+
/**
|
|
4949
|
+
* Core专用日志器
|
|
4950
|
+
*/
|
|
4951
|
+
private static _logger;
|
|
4613
4952
|
/**
|
|
4614
4953
|
* 实体系统启用状态
|
|
4615
4954
|
*
|
|
@@ -5742,7 +6081,7 @@ interface DirtyStats {
|
|
|
5742
6081
|
* dirtySystem.addListener({
|
|
5743
6082
|
* flags: DirtyFlag.TRANSFORM_CHANGED,
|
|
5744
6083
|
* callback: (data) => {
|
|
5745
|
-
*
|
|
6084
|
+
* logger.debug('Entity position changed:', data.entity.name);
|
|
5746
6085
|
* }
|
|
5747
6086
|
* });
|
|
5748
6087
|
*
|
|
@@ -5751,6 +6090,7 @@ interface DirtyStats {
|
|
|
5751
6090
|
* ```
|
|
5752
6091
|
*/
|
|
5753
6092
|
declare class DirtyTrackingSystem {
|
|
6093
|
+
private static readonly _logger;
|
|
5754
6094
|
/** 脏实体映射表 */
|
|
5755
6095
|
private _dirtyEntities;
|
|
5756
6096
|
/** 脏标记监听器 */
|
|
@@ -5853,201 +6193,6 @@ declare class DirtyTrackingSystem {
|
|
|
5853
6193
|
private estimateMemoryUsage;
|
|
5854
6194
|
}
|
|
5855
6195
|
|
|
5856
|
-
/**
|
|
5857
|
-
* 索引更新操作类型
|
|
5858
|
-
*/
|
|
5859
|
-
declare enum IndexUpdateType {
|
|
5860
|
-
ADD_ENTITY = "add_entity",
|
|
5861
|
-
REMOVE_ENTITY = "remove_entity",
|
|
5862
|
-
UPDATE_ENTITY = "update_entity"
|
|
5863
|
-
}
|
|
5864
|
-
/**
|
|
5865
|
-
* 索引更新操作
|
|
5866
|
-
*/
|
|
5867
|
-
interface IndexUpdateOperation {
|
|
5868
|
-
type: IndexUpdateType;
|
|
5869
|
-
entity: Entity;
|
|
5870
|
-
oldMask?: bigint;
|
|
5871
|
-
newMask?: bigint;
|
|
5872
|
-
}
|
|
5873
|
-
/**
|
|
5874
|
-
* 延迟索引更新器,用于批量更新查询索引以提高性能
|
|
5875
|
-
*/
|
|
5876
|
-
declare class IndexUpdateBatcher {
|
|
5877
|
-
private pendingOperations;
|
|
5878
|
-
private isProcessing;
|
|
5879
|
-
private batchSize;
|
|
5880
|
-
private flushTimeout;
|
|
5881
|
-
private flushDelay;
|
|
5882
|
-
/**
|
|
5883
|
-
* 添加索引更新操作
|
|
5884
|
-
*/
|
|
5885
|
-
addOperation(operation: IndexUpdateOperation): void;
|
|
5886
|
-
/**
|
|
5887
|
-
* 批量添加实体
|
|
5888
|
-
*/
|
|
5889
|
-
addEntities(entities: Entity[]): void;
|
|
5890
|
-
/**
|
|
5891
|
-
* 批量移除实体
|
|
5892
|
-
*/
|
|
5893
|
-
removeEntities(entities: Entity[]): void;
|
|
5894
|
-
/**
|
|
5895
|
-
* 批量更新实体
|
|
5896
|
-
*/
|
|
5897
|
-
updateEntities(updates: Array<{
|
|
5898
|
-
entity: Entity;
|
|
5899
|
-
oldMask: bigint;
|
|
5900
|
-
newMask: bigint;
|
|
5901
|
-
}>): void;
|
|
5902
|
-
/**
|
|
5903
|
-
* 安排延迟刷新
|
|
5904
|
-
*/
|
|
5905
|
-
private scheduleFlush;
|
|
5906
|
-
/**
|
|
5907
|
-
* 立即处理所有待处理的操作
|
|
5908
|
-
*/
|
|
5909
|
-
flush(): void;
|
|
5910
|
-
/**
|
|
5911
|
-
* 处理批量操作
|
|
5912
|
-
*/
|
|
5913
|
-
private processBatch;
|
|
5914
|
-
/**
|
|
5915
|
-
* 批量处理添加操作
|
|
5916
|
-
*/
|
|
5917
|
-
private processBatchAdd;
|
|
5918
|
-
/**
|
|
5919
|
-
* 批量处理移除操作
|
|
5920
|
-
*/
|
|
5921
|
-
private processBatchRemove;
|
|
5922
|
-
/**
|
|
5923
|
-
* 批量处理更新操作
|
|
5924
|
-
*/
|
|
5925
|
-
private processBatchUpdate;
|
|
5926
|
-
/**
|
|
5927
|
-
* 设置批量大小
|
|
5928
|
-
*/
|
|
5929
|
-
setBatchSize(size: number): void;
|
|
5930
|
-
/**
|
|
5931
|
-
* 设置刷新延迟
|
|
5932
|
-
*/
|
|
5933
|
-
setFlushDelay(delay: number): void;
|
|
5934
|
-
/**
|
|
5935
|
-
* 获取待处理操作数量
|
|
5936
|
-
*/
|
|
5937
|
-
getPendingCount(): number;
|
|
5938
|
-
/**
|
|
5939
|
-
* 清空所有待处理操作
|
|
5940
|
-
*/
|
|
5941
|
-
clear(): void;
|
|
5942
|
-
/**
|
|
5943
|
-
* 检查是否有待处理操作
|
|
5944
|
-
*/
|
|
5945
|
-
hasPendingOperations(): boolean;
|
|
5946
|
-
onBatchAdd?: (entities: Entity[]) => void;
|
|
5947
|
-
onBatchRemove?: (entities: Entity[]) => void;
|
|
5948
|
-
onBatchUpdate?: (updates: Array<{
|
|
5949
|
-
entity: Entity;
|
|
5950
|
-
oldMask: bigint;
|
|
5951
|
-
newMask: bigint;
|
|
5952
|
-
}>) => void;
|
|
5953
|
-
}
|
|
5954
|
-
|
|
5955
|
-
/**
|
|
5956
|
-
* 位掩码优化器,用于预计算和缓存常用的组件掩码
|
|
5957
|
-
*
|
|
5958
|
-
* 使用BigInt兼容层确保在所有平台上的正常运行。
|
|
5959
|
-
*/
|
|
5960
|
-
declare class BitMaskOptimizer {
|
|
5961
|
-
private static instance;
|
|
5962
|
-
private maskCache;
|
|
5963
|
-
private componentTypeMap;
|
|
5964
|
-
private nextComponentId;
|
|
5965
|
-
private constructor();
|
|
5966
|
-
static getInstance(): BitMaskOptimizer;
|
|
5967
|
-
/**
|
|
5968
|
-
* 注册组件类型
|
|
5969
|
-
*/
|
|
5970
|
-
registerComponentType(componentName: string): number;
|
|
5971
|
-
/**
|
|
5972
|
-
* 获取组件类型ID
|
|
5973
|
-
*/
|
|
5974
|
-
getComponentTypeId(componentName: string): number | undefined;
|
|
5975
|
-
/**
|
|
5976
|
-
* 创建单个组件的掩码
|
|
5977
|
-
* @param componentName 组件名称
|
|
5978
|
-
* @returns 组件掩码
|
|
5979
|
-
*/
|
|
5980
|
-
createSingleComponentMask(componentName: string): IBigIntLike;
|
|
5981
|
-
/**
|
|
5982
|
-
* 创建多个组件的组合掩码
|
|
5983
|
-
* @param componentNames 组件名称数组
|
|
5984
|
-
* @returns 组合掩码
|
|
5985
|
-
*/
|
|
5986
|
-
createCombinedMask(componentNames: string[]): IBigIntLike;
|
|
5987
|
-
/**
|
|
5988
|
-
* 检查掩码是否包含指定组件
|
|
5989
|
-
* @param mask 要检查的掩码
|
|
5990
|
-
* @param componentName 组件名称
|
|
5991
|
-
* @returns 是否包含指定组件
|
|
5992
|
-
*/
|
|
5993
|
-
maskContainsComponent(mask: IBigIntLike, componentName: string): boolean;
|
|
5994
|
-
/**
|
|
5995
|
-
* 检查掩码是否包含所有指定组件
|
|
5996
|
-
* @param mask 要检查的掩码
|
|
5997
|
-
* @param componentNames 组件名称数组
|
|
5998
|
-
* @returns 是否包含所有指定组件
|
|
5999
|
-
*/
|
|
6000
|
-
maskContainsAllComponents(mask: IBigIntLike, componentNames: string[]): boolean;
|
|
6001
|
-
/**
|
|
6002
|
-
* 检查掩码是否包含任一指定组件
|
|
6003
|
-
* @param mask 要检查的掩码
|
|
6004
|
-
* @param componentNames 组件名称数组
|
|
6005
|
-
* @returns 是否包含任一指定组件
|
|
6006
|
-
*/
|
|
6007
|
-
maskContainsAnyComponent(mask: IBigIntLike, componentNames: string[]): boolean;
|
|
6008
|
-
/**
|
|
6009
|
-
* 添加组件到掩码
|
|
6010
|
-
* @param mask 原始掩码
|
|
6011
|
-
* @param componentName 要添加的组件名称
|
|
6012
|
-
* @returns 新的掩码
|
|
6013
|
-
*/
|
|
6014
|
-
addComponentToMask(mask: IBigIntLike, componentName: string): IBigIntLike;
|
|
6015
|
-
/**
|
|
6016
|
-
* 从掩码中移除组件
|
|
6017
|
-
* @param mask 原始掩码
|
|
6018
|
-
* @param componentName 要移除的组件名称
|
|
6019
|
-
* @returns 新的掩码
|
|
6020
|
-
*/
|
|
6021
|
-
removeComponentFromMask(mask: IBigIntLike, componentName: string): IBigIntLike;
|
|
6022
|
-
/**
|
|
6023
|
-
* 预计算常用掩码组合
|
|
6024
|
-
*/
|
|
6025
|
-
precomputeCommonMasks(commonCombinations: string[][]): void;
|
|
6026
|
-
/**
|
|
6027
|
-
* 获取掩码缓存统计信息
|
|
6028
|
-
*/
|
|
6029
|
-
getCacheStats(): {
|
|
6030
|
-
size: number;
|
|
6031
|
-
componentTypes: number;
|
|
6032
|
-
};
|
|
6033
|
-
/**
|
|
6034
|
-
* 清空缓存
|
|
6035
|
-
*/
|
|
6036
|
-
clearCache(): void;
|
|
6037
|
-
/**
|
|
6038
|
-
* 重置优化器
|
|
6039
|
-
*/
|
|
6040
|
-
reset(): void;
|
|
6041
|
-
/**
|
|
6042
|
-
* 将掩码转换为组件名称数组
|
|
6043
|
-
*/
|
|
6044
|
-
maskToComponentNames(mask: IBigIntLike): string[];
|
|
6045
|
-
/**
|
|
6046
|
-
* 获取掩码中组件的数量
|
|
6047
|
-
*/
|
|
6048
|
-
getComponentCount(mask: IBigIntLike): number;
|
|
6049
|
-
}
|
|
6050
|
-
|
|
6051
6196
|
/**
|
|
6052
6197
|
* 组件对象池,用于复用组件实例以减少内存分配
|
|
6053
6198
|
*/
|
|
@@ -6208,355 +6353,5 @@ declare class Time {
|
|
|
6208
6353
|
static checkEvery(interval: number, lastTime: number): boolean;
|
|
6209
6354
|
}
|
|
6210
6355
|
|
|
6211
|
-
|
|
6212
|
-
|
|
6213
|
-
*
|
|
6214
|
-
* 实现此接口的类可以被快照系统序列化和反序列化
|
|
6215
|
-
*/
|
|
6216
|
-
interface ISnapshotable {
|
|
6217
|
-
/**
|
|
6218
|
-
* 序列化对象到可传输的数据格式
|
|
6219
|
-
*
|
|
6220
|
-
* @returns 序列化后的数据
|
|
6221
|
-
*/
|
|
6222
|
-
serialize(): any;
|
|
6223
|
-
/**
|
|
6224
|
-
* 从序列化数据恢复对象状态
|
|
6225
|
-
*
|
|
6226
|
-
* @param data - 序列化数据
|
|
6227
|
-
*/
|
|
6228
|
-
deserialize(data: any): void;
|
|
6229
|
-
}
|
|
6230
|
-
/**
|
|
6231
|
-
* 快照配置接口
|
|
6232
|
-
*/
|
|
6233
|
-
interface SnapshotConfig {
|
|
6234
|
-
/** 是否包含在快照中 */
|
|
6235
|
-
includeInSnapshot: boolean;
|
|
6236
|
-
/** 压缩级别 (0-9) */
|
|
6237
|
-
compressionLevel: number;
|
|
6238
|
-
/** 同步优先级 (数字越大优先级越高) */
|
|
6239
|
-
syncPriority: number;
|
|
6240
|
-
/** 是否启用增量快照 */
|
|
6241
|
-
enableIncremental: boolean;
|
|
6242
|
-
}
|
|
6243
|
-
/**
|
|
6244
|
-
* 组件快照数据
|
|
6245
|
-
*/
|
|
6246
|
-
interface ComponentSnapshot {
|
|
6247
|
-
/** 组件类型名称 */
|
|
6248
|
-
type: string;
|
|
6249
|
-
/** 组件ID */
|
|
6250
|
-
id: number;
|
|
6251
|
-
/** 序列化数据 */
|
|
6252
|
-
data: any;
|
|
6253
|
-
/** 是否启用 */
|
|
6254
|
-
enabled: boolean;
|
|
6255
|
-
/** 快照配置 */
|
|
6256
|
-
config?: SnapshotConfig;
|
|
6257
|
-
}
|
|
6258
|
-
/**
|
|
6259
|
-
* 实体快照数据
|
|
6260
|
-
*/
|
|
6261
|
-
interface EntitySnapshot {
|
|
6262
|
-
/** 实体ID */
|
|
6263
|
-
id: number;
|
|
6264
|
-
/** 实体名称 */
|
|
6265
|
-
name: string;
|
|
6266
|
-
/** 是否启用 */
|
|
6267
|
-
enabled: boolean;
|
|
6268
|
-
/** 是否激活 */
|
|
6269
|
-
active: boolean;
|
|
6270
|
-
/** 标签 */
|
|
6271
|
-
tag: number;
|
|
6272
|
-
/** 更新顺序 */
|
|
6273
|
-
updateOrder: number;
|
|
6274
|
-
/** 组件快照列表 */
|
|
6275
|
-
components: ComponentSnapshot[];
|
|
6276
|
-
/** 子实体ID列表 */
|
|
6277
|
-
children: number[];
|
|
6278
|
-
/** 父实体ID */
|
|
6279
|
-
parent?: number;
|
|
6280
|
-
/** 快照时间戳 */
|
|
6281
|
-
timestamp: number;
|
|
6282
|
-
}
|
|
6283
|
-
/**
|
|
6284
|
-
* 场景快照数据
|
|
6285
|
-
*/
|
|
6286
|
-
interface SceneSnapshot {
|
|
6287
|
-
/** 实体快照列表 */
|
|
6288
|
-
entities: EntitySnapshot[];
|
|
6289
|
-
/** 快照时间戳 */
|
|
6290
|
-
timestamp: number;
|
|
6291
|
-
/** 框架版本 */
|
|
6292
|
-
version: string;
|
|
6293
|
-
/** 快照类型 */
|
|
6294
|
-
type: 'full' | 'incremental';
|
|
6295
|
-
/** 基础快照ID(增量快照使用) */
|
|
6296
|
-
baseSnapshotId?: string;
|
|
6297
|
-
}
|
|
6298
|
-
|
|
6299
|
-
/**
|
|
6300
|
-
* 快照管理器
|
|
6301
|
-
*
|
|
6302
|
-
* 负责创建和管理ECS系统的快照,支持完整快照和增量快照
|
|
6303
|
-
*/
|
|
6304
|
-
declare class SnapshotManager {
|
|
6305
|
-
/** 默认快照配置 */
|
|
6306
|
-
private static readonly DEFAULT_CONFIG;
|
|
6307
|
-
/** 框架版本 */
|
|
6308
|
-
private readonly version;
|
|
6309
|
-
/** 最后快照时间戳 */
|
|
6310
|
-
private lastSnapshotTime;
|
|
6311
|
-
/** 快照缓存 */
|
|
6312
|
-
private snapshotCache;
|
|
6313
|
-
/** 最大缓存数量 */
|
|
6314
|
-
private maxCacheSize;
|
|
6315
|
-
/**
|
|
6316
|
-
* 创建场景快照
|
|
6317
|
-
*
|
|
6318
|
-
* @param entities - 实体列表
|
|
6319
|
-
* @param type - 快照类型
|
|
6320
|
-
* @returns 场景快照
|
|
6321
|
-
*/
|
|
6322
|
-
createSceneSnapshot(entities: Entity[], type?: 'full' | 'incremental'): SceneSnapshot;
|
|
6323
|
-
/**
|
|
6324
|
-
* 从快照恢复场景
|
|
6325
|
-
*
|
|
6326
|
-
* @param snapshot - 场景快照
|
|
6327
|
-
* @param targetEntities - 目标实体列表(用于增量恢复)
|
|
6328
|
-
* @param createMissingEntities - 是否创建缺失的实体
|
|
6329
|
-
*/
|
|
6330
|
-
restoreFromSnapshot(snapshot: SceneSnapshot, targetEntities?: Entity[], createMissingEntities?: boolean): Entity[];
|
|
6331
|
-
/**
|
|
6332
|
-
* 从快照恢复实体列表
|
|
6333
|
-
*
|
|
6334
|
-
* @param snapshot - 场景快照
|
|
6335
|
-
* @param targetEntities - 目标实体列表
|
|
6336
|
-
* @param createMissingEntities - 是否创建缺失的实体
|
|
6337
|
-
*/
|
|
6338
|
-
restoreEntitiesFromSnapshot(snapshot: SceneSnapshot, targetEntities: Entity[], createMissingEntities?: boolean): Entity[];
|
|
6339
|
-
/**
|
|
6340
|
-
* 从快照创建实体
|
|
6341
|
-
*/
|
|
6342
|
-
private createEntityFromSnapshot;
|
|
6343
|
-
/**
|
|
6344
|
-
* 从快照创建组件
|
|
6345
|
-
*/
|
|
6346
|
-
private createComponentFromSnapshot;
|
|
6347
|
-
/**
|
|
6348
|
-
* 获取组件类型
|
|
6349
|
-
*/
|
|
6350
|
-
private getComponentType;
|
|
6351
|
-
/**
|
|
6352
|
-
* 创建快速快照(跳过变化检测)
|
|
6353
|
-
*
|
|
6354
|
-
* @param entities - 实体列表
|
|
6355
|
-
* @returns 场景快照
|
|
6356
|
-
*/
|
|
6357
|
-
createQuickSnapshot(entities: Entity[]): SceneSnapshot;
|
|
6358
|
-
/**
|
|
6359
|
-
* 创建增量快照
|
|
6360
|
-
*
|
|
6361
|
-
* @param entities - 实体列表
|
|
6362
|
-
* @param baseSnapshot - 基础快照
|
|
6363
|
-
* @param enableChangeDetection - 是否启用变化检测
|
|
6364
|
-
* @returns 增量快照
|
|
6365
|
-
*/
|
|
6366
|
-
createIncrementalSnapshot(entities: Entity[], baseSnapshot: SceneSnapshot, enableChangeDetection?: boolean): SceneSnapshot;
|
|
6367
|
-
/**
|
|
6368
|
-
* 缓存快照
|
|
6369
|
-
*
|
|
6370
|
-
* @param id - 快照ID
|
|
6371
|
-
* @param snapshot - 快照数据
|
|
6372
|
-
*/
|
|
6373
|
-
cacheSnapshot(id: string, snapshot: SceneSnapshot): void;
|
|
6374
|
-
/**
|
|
6375
|
-
* 获取缓存的快照
|
|
6376
|
-
*
|
|
6377
|
-
* @param id - 快照ID
|
|
6378
|
-
* @returns 快照数据或undefined
|
|
6379
|
-
*/
|
|
6380
|
-
getCachedSnapshot(id: string): SceneSnapshot | undefined;
|
|
6381
|
-
/**
|
|
6382
|
-
* 清空快照缓存
|
|
6383
|
-
*/
|
|
6384
|
-
clearCache(): void;
|
|
6385
|
-
/**
|
|
6386
|
-
* 清空所有缓存
|
|
6387
|
-
*/
|
|
6388
|
-
clearAllCaches(): void;
|
|
6389
|
-
/**
|
|
6390
|
-
* 获取缓存统计信息
|
|
6391
|
-
*/
|
|
6392
|
-
getCacheStats(): {
|
|
6393
|
-
snapshotCacheSize: number;
|
|
6394
|
-
};
|
|
6395
|
-
/**
|
|
6396
|
-
* 创建实体快照
|
|
6397
|
-
*/
|
|
6398
|
-
private createEntitySnapshot;
|
|
6399
|
-
/**
|
|
6400
|
-
* 创建组件快照
|
|
6401
|
-
*/
|
|
6402
|
-
private createComponentSnapshot;
|
|
6403
|
-
/**
|
|
6404
|
-
* 默认组件序列化
|
|
6405
|
-
*/
|
|
6406
|
-
private defaultSerializeComponent;
|
|
6407
|
-
/**
|
|
6408
|
-
* 检查值是否可序列化
|
|
6409
|
-
*/
|
|
6410
|
-
private isSerializableValue;
|
|
6411
|
-
/**
|
|
6412
|
-
* 检查组件是否支持快照
|
|
6413
|
-
*/
|
|
6414
|
-
private isComponentSnapshotable;
|
|
6415
|
-
/**
|
|
6416
|
-
* 获取组件快照配置
|
|
6417
|
-
*/
|
|
6418
|
-
private getComponentSnapshotConfig;
|
|
6419
|
-
/**
|
|
6420
|
-
* 检查组件是否有序列化方法
|
|
6421
|
-
*/
|
|
6422
|
-
private hasSerializeMethod;
|
|
6423
|
-
/**
|
|
6424
|
-
* 恢复完整快照
|
|
6425
|
-
*/
|
|
6426
|
-
private restoreFullSnapshot;
|
|
6427
|
-
/**
|
|
6428
|
-
* 恢复增量快照
|
|
6429
|
-
*/
|
|
6430
|
-
private restoreIncrementalSnapshot;
|
|
6431
|
-
/**
|
|
6432
|
-
* 从快照恢复实体
|
|
6433
|
-
*/
|
|
6434
|
-
private restoreEntityFromSnapshot;
|
|
6435
|
-
/**
|
|
6436
|
-
* 从快照恢复组件
|
|
6437
|
-
*/
|
|
6438
|
-
private restoreComponentFromSnapshot;
|
|
6439
|
-
/**
|
|
6440
|
-
* 默认组件反序列化
|
|
6441
|
-
*/
|
|
6442
|
-
private defaultDeserializeComponent;
|
|
6443
|
-
/**
|
|
6444
|
-
* 检查实体结构是否发生变化(组件数量、类型等)
|
|
6445
|
-
*/
|
|
6446
|
-
private hasEntityStructureChanged;
|
|
6447
|
-
/**
|
|
6448
|
-
* 获取发生变化的组件列表
|
|
6449
|
-
*/
|
|
6450
|
-
private getChangedComponents;
|
|
6451
|
-
/**
|
|
6452
|
-
* 检查组件数据是否发生变化
|
|
6453
|
-
*/
|
|
6454
|
-
private hasComponentDataChanged;
|
|
6455
|
-
/**
|
|
6456
|
-
* 检查组件是否有变化检测方法
|
|
6457
|
-
*/
|
|
6458
|
-
private hasChangeDetectionMethod;
|
|
6459
|
-
/**
|
|
6460
|
-
* 创建增量实体快照(只包含变化的组件)
|
|
6461
|
-
*/
|
|
6462
|
-
private createIncrementalEntitySnapshot;
|
|
6463
|
-
/**
|
|
6464
|
-
* 生成快照ID
|
|
6465
|
-
*/
|
|
6466
|
-
private generateSnapshotId;
|
|
6467
|
-
}
|
|
6468
|
-
|
|
6469
|
-
/**
|
|
6470
|
-
* 快照扩展接口
|
|
6471
|
-
*
|
|
6472
|
-
* 为Component基类提供快照功能的扩展接口
|
|
6473
|
-
*/
|
|
6474
|
-
interface ISnapshotExtension {
|
|
6475
|
-
/** 快照配置 */
|
|
6476
|
-
snapshotConfig?: SnapshotConfig;
|
|
6477
|
-
/** 序列化方法 */
|
|
6478
|
-
serialize?(): any;
|
|
6479
|
-
/** 反序列化方法 */
|
|
6480
|
-
deserialize?(data: any): void;
|
|
6481
|
-
/** 变化检测方法 */
|
|
6482
|
-
hasChanged?(baseData: any): boolean;
|
|
6483
|
-
}
|
|
6484
|
-
/**
|
|
6485
|
-
* 快照装饰器
|
|
6486
|
-
*
|
|
6487
|
-
* 用于标记组件属性为可序列化
|
|
6488
|
-
*/
|
|
6489
|
-
declare function Serializable(config?: Partial<SnapshotConfig>): (target: any, propertyKey: string) => void;
|
|
6490
|
-
/**
|
|
6491
|
-
* 快照配置装饰器
|
|
6492
|
-
*
|
|
6493
|
-
* 用于配置组件的快照行为
|
|
6494
|
-
*/
|
|
6495
|
-
declare function SnapshotConfigDecorator(config: SnapshotConfig): (target: any) => void;
|
|
6496
|
-
/**
|
|
6497
|
-
* 快照扩展工具类
|
|
6498
|
-
*/
|
|
6499
|
-
declare class SnapshotExtension {
|
|
6500
|
-
/**
|
|
6501
|
-
* 为组件添加快照支持
|
|
6502
|
-
*
|
|
6503
|
-
* @param component - 目标组件
|
|
6504
|
-
* @param config - 快照配置
|
|
6505
|
-
*/
|
|
6506
|
-
static enableSnapshot(component: Component, config?: Partial<SnapshotConfig>): void;
|
|
6507
|
-
/**
|
|
6508
|
-
* 禁用组件的快照功能
|
|
6509
|
-
*
|
|
6510
|
-
* @param component - 目标组件
|
|
6511
|
-
*/
|
|
6512
|
-
static disableSnapshot(component: Component): void;
|
|
6513
|
-
/**
|
|
6514
|
-
* 检查组件是否支持快照
|
|
6515
|
-
*
|
|
6516
|
-
* @param component - 目标组件
|
|
6517
|
-
* @returns 是否支持快照
|
|
6518
|
-
*/
|
|
6519
|
-
static isSnapshotable(component: Component): boolean;
|
|
6520
|
-
/**
|
|
6521
|
-
* 获取组件的可序列化属性
|
|
6522
|
-
*
|
|
6523
|
-
* @param component - 目标组件
|
|
6524
|
-
* @returns 可序列化属性列表
|
|
6525
|
-
*/
|
|
6526
|
-
static getSerializableProperties(component: Component): string[];
|
|
6527
|
-
/**
|
|
6528
|
-
* 创建组件的默认序列化方法
|
|
6529
|
-
*
|
|
6530
|
-
* @param component - 目标组件
|
|
6531
|
-
* @returns 序列化数据
|
|
6532
|
-
*/
|
|
6533
|
-
static createDefaultSerializer(component: Component): () => any;
|
|
6534
|
-
/**
|
|
6535
|
-
* 创建组件的默认反序列化方法
|
|
6536
|
-
*
|
|
6537
|
-
* @param component - 目标组件
|
|
6538
|
-
* @returns 反序列化函数
|
|
6539
|
-
*/
|
|
6540
|
-
static createDefaultDeserializer(component: Component): (data: any) => void;
|
|
6541
|
-
/**
|
|
6542
|
-
* 创建简单的变化检测方法
|
|
6543
|
-
*
|
|
6544
|
-
* @param component - 目标组件
|
|
6545
|
-
* @returns 变化检测函数
|
|
6546
|
-
*/
|
|
6547
|
-
static createSimpleChangeDetector(component: Component): (baseData: any) => boolean;
|
|
6548
|
-
/**
|
|
6549
|
-
* 创建深度变化检测方法
|
|
6550
|
-
*
|
|
6551
|
-
* @param component - 目标组件
|
|
6552
|
-
* @returns 变化检测函数
|
|
6553
|
-
*/
|
|
6554
|
-
static createDeepChangeDetector(component: Component): (baseData: any) => boolean;
|
|
6555
|
-
/**
|
|
6556
|
-
* 深度比较两个值
|
|
6557
|
-
*/
|
|
6558
|
-
private static deepCompare;
|
|
6559
|
-
}
|
|
6560
|
-
|
|
6561
|
-
export { ArchetypeSystem, AsyncEventHandler, BitMaskOptimizer, BitmapComponentIndex, Bits, Component, ComponentDataCollector, ComponentIndexManager, ComponentPool, ComponentPoolManager, ComponentStorage, ComponentTypeManager, Core, DebugManager, DirtyFlag, DirtyTrackingSystem, ECSEventType, ECSFluentAPI, EVENT_TYPES, Emitter, Entity, EntityDataCollector, EntityList, EntityManager, EntityProcessorList, EntityQueryBuilder, EntitySystem, EventBus, EventHandler, EventPriority, EventTypeValidator, FuncPack, GlobalEventBus, GlobalManager, HashComponentIndex, IdentifierPool, IndexType, IndexUpdateBatcher, IntervalSystem, Matcher, NumberExtension, PassiveSystem, PerformanceDataCollector, PerformanceMonitor, PerformanceWarningType, Pool, PoolManager, ProcessingSystem, QuerySystem, Scene, SceneDataCollector, Serializable, SnapshotConfigDecorator, SnapshotExtension, SnapshotManager, SystemDataCollector, TieredObjectPool, Time, Timer, TimerManager, TypeSafeEventSystem, TypeUtils, WebSocketManager, createECSAPI };
|
|
6562
|
-
export type { Archetype, ArchetypeQueryResult, ComponentSnapshot, ComponentType$1 as ComponentType, DirtyData, DirtyListener, EntitySnapshot, EventListenerConfig, EventStats, IComponent, IComponentDebugData, IComponentEventData, ICoreConfig, IECSDebugConfig, IECSDebugData, IEntityDebugData, IEntityEventData, IEntityHierarchyNode, IEventBus, IEventData, IEventListenerConfig, IEventStats, IPerformanceDebugData, IPerformanceEventData, IPoolable, ISceneDebugData, ISceneEventData, ISnapshotExtension, ISnapshotable, ISystemBase, ISystemDebugData, ISystemEventData, ITimer, PerformanceData, PerformanceStats, PerformanceThresholds, PerformanceWarning, PoolStats, SceneSnapshot, SnapshotConfig };
|
|
6356
|
+
export { ArchetypeSystem, AsyncEventHandler, BigIntFactory, BitmapComponentIndex, Bits, Component, ComponentDataCollector, ComponentIndexManager, ComponentPool, ComponentPoolManager, ComponentRegistry, ComponentStorage, ComponentTypeManager, ConsoleLogger, Core, DebugManager, DirtyFlag, DirtyTrackingSystem, ECSEventType, ECSFluentAPI, EVENT_TYPES, Emitter, EnableSoA, Entity, EntityDataCollector, EntityList, EntityManager, EntityProcessorList, EntityQueryBuilder, EntitySystem, EventBus, EventHandler, EventPriority, EventTypeValidator, Float32, Float64, FuncPack, GlobalEventBus, GlobalManager, HashComponentIndex, HighPrecision, IdentifierPool, IndexType, Int32, IntervalSystem, LogLevel, Logger, LoggerManager, Matcher, NumberExtension, PassiveSystem, PerformanceDataCollector, PerformanceMonitor, PerformanceWarningType, Pool, PoolManager, ProcessingSystem, QuerySystem, Scene, SceneDataCollector, SerializeMap, SoAStorage, SystemDataCollector, Time, Timer, TimerManager, TypeSafeEventSystem, TypeUtils, WebSocketManager, createECSAPI, createLogger, setGlobalLogLevel };
|
|
6357
|
+
export type { Archetype, ArchetypeQueryResult, ComponentType$1 as ComponentType, DirtyData, DirtyListener, EventListenerConfig, EventStats, IComponent, IComponentDebugData, IComponentEventData, ICoreConfig, IECSDebugConfig, IECSDebugData, IEntityDebugData, IEntityEventData, IEntityHierarchyNode, IEventBus, IEventData, IEventListenerConfig, IEventStats, ILogger, IPerformanceDebugData, IPerformanceEventData, IPoolable, ISceneDebugData, ISceneEventData, ISystemBase, ISystemDebugData, ISystemEventData, ITimer, LoggerConfig, PerformanceData, PerformanceStats, PerformanceThresholds, PerformanceWarning, PoolStats };
|