2023-06-12 06:34:20 +02:00
|
|
|
import { LocationName, CityName } from "@enums";
|
2019-03-27 09:31:47 +01:00
|
|
|
|
2022-10-04 12:40:10 +02:00
|
|
|
/** Class representing a City in the game */
|
2019-03-27 09:31:47 +01:00
|
|
|
export class City {
|
2022-10-04 12:40:10 +02:00
|
|
|
/** List of all locations in this city */
|
2021-09-05 01:09:30 +02:00
|
|
|
locations: LocationName[];
|
2019-03-27 09:31:47 +01:00
|
|
|
|
2022-10-04 12:40:10 +02:00
|
|
|
/** Name of this city */
|
2021-09-05 01:09:30 +02:00
|
|
|
name: CityName;
|
2019-03-27 09:31:47 +01:00
|
|
|
|
2022-10-04 12:40:10 +02:00
|
|
|
/** Metro map ascii art */
|
2021-09-05 01:09:30 +02:00
|
|
|
asciiArt: string;
|
2021-03-07 22:14:08 +01:00
|
|
|
|
2021-09-05 01:09:30 +02:00
|
|
|
constructor(name: CityName, locations: LocationName[] = [], asciiArt = "") {
|
|
|
|
this.name = name;
|
|
|
|
this.locations = locations;
|
|
|
|
this.asciiArt = asciiArt;
|
|
|
|
}
|
2019-03-29 08:12:41 +01:00
|
|
|
|
2021-09-05 01:09:30 +02:00
|
|
|
addLocation(loc: LocationName): void {
|
|
|
|
this.locations.push(loc);
|
|
|
|
}
|
2019-03-27 09:31:47 +01:00
|
|
|
}
|