style(core): ESLint自动修复代码格式问题 (#210)

This commit is contained in:
YHH
2025-11-01 17:41:50 +08:00
committed by GitHub
parent 4355538d8d
commit 620f3eecc7
80 changed files with 634 additions and 640 deletions

View File

@@ -154,7 +154,7 @@ export class EntityCache {
trackedCount: number;
frameEntityCount: number;
persistentEntityCount: number;
} {
} {
return {
hasFrame: this._frameCache !== null,
hasPersistent: this._persistentCache !== null,

View File

@@ -55,4 +55,4 @@ export abstract class IntervalSystem extends EntitySystem {
protected getIntervalDelta(): number {
return this.interval + this.intervalRemainder;
}
}
}

View File

@@ -8,7 +8,7 @@ import { Matcher } from '../Utils/Matcher';
* 被动的实体系统不会对实体进行任何修改,只会被动地接收实体的变化事件
*/
export abstract class PassiveSystem extends EntitySystem {
constructor(matcher?: Matcher) {
super(matcher);
}

View File

@@ -8,7 +8,7 @@ import { Matcher } from '../Utils/Matcher';
* 子类需要实现processSystem方法用于实现具体的处理逻辑
*/
export abstract class ProcessingSystem extends EntitySystem {
constructor(matcher?: Matcher) {
super(matcher);
}

View File

@@ -197,7 +197,7 @@ export abstract class WorkerEntitySystem<TEntityData = any> extends EntitySystem
protected sharedBuffer: SharedArrayBuffer | null = null;
protected sharedFloatArray: Float32Array | null = null;
private platformAdapter: IPlatformAdapter;
private hasLoggedSyncMode = false;
private hasLoggedSyncMode = false;
constructor(matcher?: Matcher, config: WorkerSystemConfig = {}) {
super(matcher);
@@ -414,7 +414,7 @@ export abstract class WorkerEntitySystem<TEntityData = any> extends EntitySystem
${sharedProcessFunctionBody}
};
userProcessFunction(sharedFloatArray, startIndex, endIndex, deltaTime, systemConfig);
` : ``}
` : ''}
}
`;
}
@@ -494,7 +494,7 @@ export abstract class WorkerEntitySystem<TEntityData = any> extends EntitySystem
const deltaTime = Time.deltaTime;
// 3. Worker执行阶段
const promises = batches.map(batch =>
const promises = batches.map((batch) =>
this.workerPool!.execute({
entities: batch,
deltaTime,
@@ -525,7 +525,7 @@ export abstract class WorkerEntitySystem<TEntityData = any> extends EntitySystem
*/
private processSynchronously(entities: readonly Entity[]): void {
// 1. 数据提取阶段
const entityData = entities.map(entity => this.extractEntityData(entity));
const entityData = entities.map((entity) => this.extractEntityData(entity));
// 2. 主线程处理阶段
const deltaTime = Time.deltaTime;
@@ -534,7 +534,7 @@ export abstract class WorkerEntitySystem<TEntityData = any> extends EntitySystem
// 3. 结果应用阶段
// 处理Promise返回值
if (results && typeof (results as any).then === 'function') {
(results as Promise<TEntityData[]>).then(finalResults => {
(results as Promise<TEntityData[]>).then((finalResults) => {
entities.forEach((entity, index) => {
this.applyResult(entity, finalResults[index]!);
});
@@ -813,7 +813,7 @@ export abstract class WorkerEntitySystem<TEntityData = any> extends EntitySystem
sharedArrayBufferSupported: boolean;
sharedArrayBufferEnabled: boolean;
currentMode: 'shared-buffer' | 'worker' | 'sync';
} {
} {
let currentMode: 'shared-buffer' | 'worker' | 'sync' = 'sync';
if (this.config.enableWorker && this.workerPool) {

View File

@@ -10,4 +10,4 @@ export type {
WorkerProcessFunction,
WorkerSystemConfig,
SharedArrayBufferProcessFunction
} from './WorkerEntitySystem';
} from './WorkerEntitySystem';