Added default marker for unkown units

This commit is contained in:
Pax1601
2023-11-18 19:01:47 +01:00
parent 283b9e682e
commit 51defbb8b2
4 changed files with 69 additions and 26 deletions

View File

@@ -1,5 +1,6 @@
import { getApp } from "../..";
import { GAME_MASTER } from "../../constants/constants";
import { UnitBlueprint } from "../../interfaces";
import { UnitDatabase } from "./unitdatabase"
export class AircraftDatabase extends UnitDatabase {

View File

@@ -3,7 +3,7 @@ import { getApp } from "../..";
import { GAME_MASTER } from "../../constants/constants";
import { UnitBlueprint } from "../../interfaces";
export class UnitDatabase {
export abstract class UnitDatabase {
blueprints: { [key: string]: UnitBlueprint } = {};
#url: string;
@@ -31,9 +31,7 @@ export class UnitDatabase {
}
}
getCategory() {
return "";
}
abstract getCategory(): string;
/* Gets a specific blueprint by name */
getByName(name: string) {
@@ -240,4 +238,15 @@ export class UnitDatabase {
getSpawnPointsByName(name: string) {
return Infinity;
}
getUnkownUnit(name: string): UnitBlueprint {
return {
name: name,
enabled: true,
coalition: 'neutral',
era: 'N/A',
label: name,
shortLabel: ''
}
}
}