use server.cs CreateServer() as the entry point for mission loading (#11)

* use server.cs CreateServer() as the entry point for mission loading

* explain why onMissionLoadDone is necessary
This commit is contained in:
Brian Beck 2025-12-02 19:14:07 -08:00 committed by GitHub
parent 10b4a65a87
commit 62f3487189
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 2131 additions and 374 deletions

View file

@ -89,6 +89,50 @@ export class CaseInsensitiveMap<V> {
}
}
/**
* Set with case-insensitive membership checks.
*/
export class CaseInsensitiveSet {
private set = new Set<string>();
constructor(values?: Iterable<string> | null) {
if (values) {
for (const value of values) {
this.add(value);
}
}
}
get size(): number {
return this.set.size;
}
add(value: string): this {
this.set.add(value.toLowerCase());
return this;
}
has(value: string): boolean {
return this.set.has(value.toLowerCase());
}
delete(value: string): boolean {
return this.set.delete(value.toLowerCase());
}
clear(): void {
this.set.clear();
}
[Symbol.iterator](): IterableIterator<string> {
return this.set[Symbol.iterator]();
}
get [Symbol.toStringTag](): string {
return "CaseInsensitiveSet";
}
}
export function normalizePath(path: string): string {
return path.replace(/\\/g, "/").toLowerCase();
}