2019-03-27 01:31:47 -07:00
|
|
|
/**
|
|
|
|
* Class representing a City in the game
|
|
|
|
*/
|
|
|
|
import { CityName } from "./data/CityNames";
|
2019-03-29 00:12:41 -07:00
|
|
|
import { LocationName } from "./data/LocationNames";
|
2019-03-27 01:31:47 -07:00
|
|
|
|
|
|
|
export class City {
|
|
|
|
/**
|
|
|
|
* List of all locations in this city
|
|
|
|
*/
|
2019-03-29 00:12:41 -07:00
|
|
|
locations: LocationName[];
|
2019-03-27 01:31:47 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Name of this city
|
|
|
|
*/
|
|
|
|
name: CityName;
|
|
|
|
|
2021-03-07 16:14:08 -05:00
|
|
|
/**
|
|
|
|
* Metro map ascii art
|
|
|
|
*/
|
|
|
|
asciiArt: string;
|
|
|
|
|
2021-04-29 23:52:56 -04:00
|
|
|
constructor(name: CityName, locations: LocationName[]=[], asciiArt='') {
|
2019-03-27 01:31:47 -07:00
|
|
|
this.name = name;
|
|
|
|
this.locations = locations;
|
2021-03-07 16:14:08 -05:00
|
|
|
this.asciiArt = asciiArt;
|
2019-03-27 01:31:47 -07:00
|
|
|
}
|
2019-03-29 00:12:41 -07:00
|
|
|
|
|
|
|
addLocation(loc: LocationName): void {
|
|
|
|
this.locations.push(loc);
|
|
|
|
}
|
2019-03-27 01:31:47 -07:00
|
|
|
}
|