Files
esengine/packages/core/src/ECS/Systems/ProcessingSystem.ts

30 lines
850 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import { EntitySystem } from './EntitySystem';
import { Entity } from '../Entity';
import { Matcher } from '../Utils/Matcher';
/**
* 处理系统抽象类
* 定义一个处理实体的抽象类继承自EntitySystem类
* 子类需要实现processSystem方法用于实现具体的处理逻辑
*/
export abstract class ProcessingSystem extends EntitySystem {
constructor(matcher?: Matcher) {
super(matcher);
}
/**
* 处理实体每帧调用processSystem方法进行处理
* @param entities 实体数组,未被使用
*/
protected override process(_entities: Entity[]): void {
// 调用子类实现的processSystem方法进行实体处理
this.processSystem();
}
/**
* 处理实体的具体方法,由子类实现
*/
public abstract processSystem(): void;
}