mirror of
https://github.com/MartinKral/Slash-The-Hordes
synced 2025-04-21 22:38:52 +00:00
24 lines
584 B
TypeScript
24 lines
584 B
TypeScript
import { Node } from "cc";
|
|
import { Enemy } from "./Enemy";
|
|
|
|
export abstract class EnemyMover {
|
|
protected targetNode: Node;
|
|
protected enemies: Enemy[] = [];
|
|
|
|
public constructor(targetNode: Node) {
|
|
this.targetNode = targetNode;
|
|
}
|
|
public addEnemy(enemy: Enemy): void {
|
|
this.enemies.push(enemy);
|
|
}
|
|
|
|
public removeEnemy(enemy: Enemy): void {
|
|
const index: number = this.enemies.indexOf(enemy);
|
|
if (index != -1) {
|
|
this.enemies.splice(index, 1);
|
|
}
|
|
}
|
|
|
|
public abstract gameTick(deltaTime: number): void;
|
|
}
|