Air defence has its own spawn icon

This commit is contained in:
PeekabooSteam
2023-11-05 10:57:53 +00:00
parent 840033aa6a
commit aad0fd22ad
8 changed files with 86 additions and 32 deletions

View File

@@ -94,10 +94,12 @@ export class UnitDatabase {
}
/* Returns a list of all possible types in a database */
getTypes() {
getTypes(unitFilter?:CallableFunction) {
var filteredBlueprints = this.getBlueprints();
var types: string[] = [];
for (let unit in filteredBlueprints) {
if ( typeof unitFilter === "function" && !unitFilter(filteredBlueprints[unit]))
continue;
var type = filteredBlueprints[unit].type;
if (type && type !== "" && !types.includes(type))
types.push(type);