From 75bc34208c84857f8b4c83542784d15db1debb0f Mon Sep 17 00:00:00 2001 From: danielyxie Date: Wed, 27 Mar 2019 01:31:47 -0700 Subject: [PATCH] Initial commit for Location Code refactor --- src/Corporation/Product.ts | 2 +- src/Corporation/ui/MainPanel.jsx | 4 +- src/Locations.ts | 90 ------- src/Locations/Cities.ts | 17 +- src/Locations/City.ts | 22 ++ src/Locations/Location.ts | 38 +++ src/Locations/LocationTypeEnum.ts | 14 ++ src/Locations/Locations.ts | 27 ++ src/Locations/data/CityNames.ts | 12 + src/Locations/data/LocationNames.ts | 92 +++++++ src/Locations/data/LocationsMetadata.ts | 316 ++++++++++++++++++++++++ src/PersonObjects/Person.ts | 4 +- src/PersonObjects/Sleeve/Sleeve.ts | 20 +- 13 files changed, 541 insertions(+), 117 deletions(-) delete mode 100644 src/Locations.ts create mode 100644 src/Locations/City.ts create mode 100644 src/Locations/Location.ts create mode 100644 src/Locations/LocationTypeEnum.ts create mode 100644 src/Locations/Locations.ts create mode 100644 src/Locations/data/CityNames.ts create mode 100644 src/Locations/data/LocationNames.ts create mode 100644 src/Locations/data/LocationsMetadata.ts diff --git a/src/Corporation/Product.ts b/src/Corporation/Product.ts index 6f8524e62..1afda5b57 100644 --- a/src/Corporation/Product.ts +++ b/src/Corporation/Product.ts @@ -3,7 +3,7 @@ import { MaterialSizes } from "./MaterialSizes"; import { ProductRatingWeights, IProductRatingWeight } from "./ProductRatingWeights"; -import { Cities } from "../Locations/Cities"; +import { CityName } from "../Locations/data/CityNames"; import { IMap } from "../types"; import { Generic_fromJSON, diff --git a/src/Corporation/ui/MainPanel.jsx b/src/Corporation/ui/MainPanel.jsx index f67827feb..d22c9a869 100644 --- a/src/Corporation/ui/MainPanel.jsx +++ b/src/Corporation/ui/MainPanel.jsx @@ -11,7 +11,7 @@ import { overviewPage } from "./Routing"; import { OfficeSpace } from "../Corporation"; -import { Cities } from "../../Locations/Cities"; +import { CityName } from "../../Locations/data/Cities"; export class MainPanel extends BaseReactComponent { constructor(props) { @@ -19,7 +19,7 @@ export class MainPanel extends BaseReactComponent { this.state = { division: "", - city: Cities.Sector12, + city: CityName.Sector12, } } diff --git a/src/Locations.ts b/src/Locations.ts deleted file mode 100644 index 35477941e..000000000 --- a/src/Locations.ts +++ /dev/null @@ -1,90 +0,0 @@ -import { IMap } from "./types"; - -/** - * Display Location Content when visiting somewhere in the World - */ -// tslint:disable-next-line:variable-name -export const Locations: IMap = { - // Cities - Aevum: "Aevum", - Chongqing: "Chongqing", - Ishima: "Ishima", - NewTokyo: "New Tokyo", - Sector12: "Sector-12", - Volhaven: "Volhaven", - - // Aevum Locations - AevumAeroCorp: "AeroCorp", - AevumBachmanAndAssociates: "Bachman & Associates", - AevumClarkeIncorporated: "Clarke Incorporated", - AevumCrushFitnessGym: "Crush Fitness Gym", - AevumECorp: "ECorp", - AevumFulcrumTechnologies: "Fulcrum Technologies", - AevumGalacticCybersystems: "Galactic Cybersystems", - AevumNetLinkTechnologies: "NetLink Technologies", - AevumPolice: "Aevum Police Headquarters", - AevumRhoConstruction: "Rho Construction", - AevumSlums: "Aevum Slums", - AevumSnapFitnessGym: "Snap Fitness Gym", - AevumSummitUniversity: "Summit University", - AevumTravelAgency: "Aevum Travel Agency", - AevumWatchdogSecurity: "Watchdog Security", - - // Chongqing locations - ChongqingKuaiGongInternational: "KuaiGong International", - ChongqingSlums: "Chongqing Slums", - ChongqingSolarisSpaceSystems: "Solaris Space Systems", - ChongqingTravelAgency: "Chongqing Travel Agency", - - // Sector 12 - Sector12AlphaEnterprises: "Alpha Enterprises", - Sector12BladeIndustries: "Blade Industries", - Sector12CIA: "Central Intelligence Agency", - Sector12CarmichaelSecurity: "Carmichael Security", - Sector12CityHall: "Sector-12 City Hall", - Sector12DeltaOne: "DeltaOne", - Sector12FoodNStuff: "FoodNStuff", - Sector12FourSigma: "Four Sigma", - Sector12IcarusMicrosystems: "Icarus Microsystems", - Sector12IronGym: "Iron Gym", - Sector12JoesGuns: "Joe's Guns", - Sector12MegaCorp: "MegaCorp", - Sector12NSA: "National Security Agency", - Sector12PowerhouseGym: "Powerhouse Gym", - Sector12RothmanUniversity: "Rothman University", - Sector12Slums: "Sector-12 Slums", - Sector12TravelAgency: "Sector-12 Travel Agency", - Sector12UniversalEnergy: "Universal Energy", - - // New Tokyo - NewTokyoDefComm: "DefComm", - NewTokyoGlobalPharmaceuticals: "Global Pharmaceuticals", - NewTokyoNoodleBar: "Noodle Bar", - NewTokyoSlums: "New Tokyo Slums", - NewTokyoTravelAgency: "New Tokyo Travel Agency", - NewTokyoVitaLife: "VitaLife", - - // Ishima - IshimaNovaMedical: "Nova Medical", - IshimaOmegaSoftware: "Omega Software", - IshimaSlums: "Ishima Slums", - IshimaStormTechnologies: "Storm Technologies", - IshimaTravelAgency: "Ishima Travel Agency", - - // Volhaven - VolhavenCompuTek: "CompuTek", - VolhavenHeliosLabs: "Helios Labs", - VolhavenLexoCorp: "LexoCorp", - VolhavenMilleniumFitnessGym: "Millenium Fitness Gym", - VolhavenNWO: "NWO", - VolhavenOmniTekIncorporated: "OmniTek Incorporated", - VolhavenOmniaCybersystems: "Omnia Cybersystems", - VolhavenSlums: "Volhaven Slums", - VolhavenSysCoreSecurities: "SysCore Securities", - VolhavenTravelAgency: "Volhaven Travel Agency", - VolhavenZBInstituteOfTechnology: "ZB Institute of Technology", - - // Generic locations - Hospital: "Hospital", - WorldStockExchange: "World Stock Exchange", -}; diff --git a/src/Locations/Cities.ts b/src/Locations/Cities.ts index 660c29a47..fc138ad25 100644 --- a/src/Locations/Cities.ts +++ b/src/Locations/Cities.ts @@ -1,14 +1,7 @@ -import { IMap } from "../types"; - /** - * Display Location Content when visiting somewhere in the World + * Map of all Cities in the game + * Key = City Name, Value = City object */ -// tslint:disable-next-line:variable-name -export const Cities: IMap = { - Aevum: "Aevum", - Chongqing: "Chongqing", - Ishima: "Ishima", - NewTokyo: "New Tokyo", - Sector12: "Sector-12", - Volhaven: "Volhaven", -}; +export interface IMetadata = { + name: string; +} diff --git a/src/Locations/City.ts b/src/Locations/City.ts new file mode 100644 index 000000000..14aae4a7c --- /dev/null +++ b/src/Locations/City.ts @@ -0,0 +1,22 @@ +/** + * Class representing a City in the game + */ +import { Location } from "./Location"; +import { CityName } from "./data/CityNames"; + +export class City { + /** + * List of all locations in this city + */ + locations: Location[]; + + /** + * Name of this city + */ + name: CityName; + + constructor(name: CityName, locations: Location[]) { + this.name = name; + this.locations = locations; + } +} diff --git a/src/Locations/Location.ts b/src/Locations/Location.ts new file mode 100644 index 000000000..3cc97609c --- /dev/null +++ b/src/Locations/Location.ts @@ -0,0 +1,38 @@ +/** + * Class representing a visitable location in the world + */ +import { CityName } from "./data/CityNames"; +import { LocationName } from "./data/LocationNames"; +import { LocationType } from "./LocationTypeEnum"; + +export interface IConstructorParams { + city?: CityName | null; + name?: LocationName; + types?: LocationType[]; + techVendorMaxRam?: number; +} + +export class Location { + // Name of city this location is in + // If this property is null, it means this is a generic Location that + // is available in all cities + city: CityName | null = null; + + // Identifier for location + name: LocationName = LocationName.Void; + + // List of what type(s) this location is + // A location can be multiple types (e.g. company and tech vendor) + types: LocationType[] = []; + + // Tech vendors allow you to purchase servers. + // This property defines the max RAM server you can purchase from this vendor + techVendorMaxRam: number = 0; + + constructor(p: IConstructorParams) { + if (p.city) { this.city = p.city; } + if (p.name) { this.name = p.name; } + if (p.types) { this.types = p.types; } + if (p.techVendorMaxRam) { this.techVendorMaxRam = p.techVendorMaxRam; } + } +} diff --git a/src/Locations/LocationTypeEnum.ts b/src/Locations/LocationTypeEnum.ts new file mode 100644 index 000000000..ddfeafbce --- /dev/null +++ b/src/Locations/LocationTypeEnum.ts @@ -0,0 +1,14 @@ +/** + * Enum defining the different types of possible locations + */ +export enum LocationType { + CityHall, + Company, + Gym, + Hospital, + Slums, + StockMarket, + TechVendor, + TravelAgency, + University, +} diff --git a/src/Locations/Locations.ts b/src/Locations/Locations.ts new file mode 100644 index 000000000..d91095247 --- /dev/null +++ b/src/Locations/Locations.ts @@ -0,0 +1,27 @@ +/** + * Map of all Locations in the game + * Key = Location name, value = Location object + */ +import { Location, + IConstructorParams } from "./Location"; +import { LocationsMetadata } from "./data/LocationsMetadata"; + +import { IMap } from "../types"; + +export const Locations: IMap = {}; + +function constructLocation(p: IConstructorParams) { + if (!p.name) { + throw new Error(`Invalid constructor parameters for Location. No 'name' property`); + } + + if (Locations[p.name] instanceof Location) { + console.warn(`Property with name ${p.name} already exists and is being overwritten`); + } + + Locations[p.name] = new Location(p); +} + +for (const metadata of LocationsMetadata { + constructLocation(metadata); +} diff --git a/src/Locations/data/CityNames.ts b/src/Locations/data/CityNames.ts new file mode 100644 index 000000000..8b02aa2a5 --- /dev/null +++ b/src/Locations/data/CityNames.ts @@ -0,0 +1,12 @@ +/** + * All possible Cities in the game. Names only, not actual "City" object + * Implemented as an enum for typing purposes + */ +export enum CityName { + Aevum = "Aevum", + Chongqing = "Chongqing", + Ishima = "Ishima", + NewTokyo = "New Tokyo", + Sector12 = "Sector-12", + Volhaven = "Volhaven", +}; diff --git a/src/Locations/data/LocationNames.ts b/src/Locations/data/LocationNames.ts new file mode 100644 index 000000000..af0d56157 --- /dev/null +++ b/src/Locations/data/LocationNames.ts @@ -0,0 +1,92 @@ +/** + * Names of all locations + */ +export enum LocationName { + // Cities + Aevum = "Aevum", + Chongqing = "Chongqing", + Ishima = "Ishima", + NewTokyo = "New Tokyo", + Sector12 = "Sector-12", + Volhaven = "Volhaven", + + // Aevum Locations + AevumAeroCorp = "AeroCorp", + AevumBachmanAndAssociates = "Bachman & Associates", + AevumClarkeIncorporated = "Clarke Incorporated", + AevumCrushFitnessGym = "Crush Fitness Gym", + AevumECorp = "ECorp", + AevumFulcrumTechnologies = "Fulcrum Technologies", + AevumGalacticCybersystems = "Galactic Cybersystems", + AevumNetLinkTechnologies = "NetLink Technologies", + AevumPolice = "Aevum Police Headquarters", + AevumRhoConstruction = "Rho Construction", + AevumSlums = "Aevum Slums", // TODO Delete this and other Slums locations + AevumSnapFitnessGym = "Snap Fitness Gym", + AevumSummitUniversity = "Summit University", + AevumTravelAgency = "Aevum Travel Agency", // TODO Delete this and other travel agency locations + AevumWatchdogSecurity = "Watchdog Security", + + // Chongqing locations + ChongqingKuaiGongInternational = "KuaiGong International", + ChongqingSlums = "Chongqing Slums", + ChongqingSolarisSpaceSystems = "Solaris Space Systems", + ChongqingTravelAgency = "Chongqing Travel Agency", + + // Sector 12 + Sector12AlphaEnterprises = "Alpha Enterprises", + Sector12BladeIndustries = "Blade Industries", + Sector12CIA = "Central Intelligence Agency", + Sector12CarmichaelSecurity = "Carmichael Security", + Sector12CityHall = "Sector-12 City Hall", + Sector12DeltaOne = "DeltaOne", + Sector12FoodNStuff = "FoodNStuff", + Sector12FourSigma = "Four Sigma", + Sector12IcarusMicrosystems = "Icarus Microsystems", + Sector12IronGym = "Iron Gym", + Sector12JoesGuns = "Joe's Guns", + Sector12MegaCorp = "MegaCorp", + Sector12NSA = "National Security Agency", + Sector12PowerhouseGym = "Powerhouse Gym", + Sector12RothmanUniversity = "Rothman University", + Sector12Slums = "Sector-12 Slums", + Sector12TravelAgency = "Sector-12 Travel Agency", + Sector12UniversalEnergy = "Universal Energy", + + // New Tokyo + NewTokyoDefComm = "DefComm", + NewTokyoGlobalPharmaceuticals = "Global Pharmaceuticals", + NewTokyoNoodleBar = "Noodle Bar", + NewTokyoSlums = "New Tokyo Slums", + NewTokyoTravelAgency = "New Tokyo Travel Agency", + NewTokyoVitaLife = "VitaLife", + + // Ishima + IshimaNovaMedical = "Nova Medical", + IshimaOmegaSoftware = "Omega Software", + IshimaSlums = "Ishima Slums", + IshimaStormTechnologies = "Storm Technologies", + IshimaTravelAgency = "Ishima Travel Agency", + + // Volhaven + VolhavenCompuTek = "CompuTek", + VolhavenHeliosLabs = "Helios Labs", + VolhavenLexoCorp = "LexoCorp", + VolhavenMilleniumFitnessGym = "Millenium Fitness Gym", + VolhavenNWO = "NWO", + VolhavenOmniTekIncorporated = "OmniTek Incorporated", + VolhavenOmniaCybersystems = "Omnia Cybersystems", + VolhavenSlums = "Volhaven Slums", + VolhavenSysCoreSecurities = "SysCore Securities", + VolhavenTravelAgency = "Volhaven Travel Agency", + VolhavenZBInstituteOfTechnology = "ZB Institute of Technology", + + // Generic locations + Hospital = "Hospital", + Slums = "The Slums", + TravelAgency = "Travel Agency", + WorldStockExchange = "World Stock Exchange", + + // Default name for Location objects + Void = "The Void", +}; diff --git a/src/Locations/data/LocationsMetadata.ts b/src/Locations/data/LocationsMetadata.ts new file mode 100644 index 000000000..fb8ae03e3 --- /dev/null +++ b/src/Locations/data/LocationsMetadata.ts @@ -0,0 +1,316 @@ +/** + * Metadata for constructing Location objects for all Locations + * in the game + */ +import { CityName } from "./CityNames"; +import { LocationName } from "./LocationNames"; +import { IConstructorParams } from "../Location"; + +export const LocationsMetadata: IConstructorParams[] = [ + { + city: CityName.Aevum, + name: LocationName.AevumAeroCorp, + types: + techVendorMaxRam: + }, + { + city: CityName.Aevum, + name: LocationName.AevumBachmanAndAssociates, + types: + techVendorMaxRam: + }, + { + city: CityName.Aevum, + name: LocationName.AevumClarkeIncorporated, + types: + techVendorMaxRam: + }, + { + city: CityName.Aevum, + name: LocationName.AevumCrushFitnessGym, + types: + techVendorMaxRam: + }, + { + city: CityName.Aevum, + name: LocationName.AevumECorp, + types: + techVendorMaxRam: + }, + { + city: CityName.Aevum, + name: LocationName.AevumFulcrumTechnologies, + types: + techVendorMaxRam: + }, + { + city: CityName.Aevum, + name: LocationName.AevumGalacticCybersystems, + types: + techVendorMaxRam: + }, + { + city: CityName.Aevum, + name: LocationName.AevumNetLinkTechnologies + types: + techVendorMaxRam: + }, + { + city: CityName.Aevum, + name: LocationName.AevumPolice, + types: + techVendorMaxRam: + }, + { + city: CityName.Aevum, + name: LocationName.AevumRhoConstruction, + types: + techVendorMaxRam: + }, + { + city: CityName.Aevum, + name: LocationName.AevumSnapFitnessGym, + types: + techVendorMaxRam: + }, + { + city: CityName.Aevum, + name: LocationName.AevumSummitUniversity, + types: + techVendorMaxRam: + }, + { + city: CityName.Aevum, + name: LocationName.AevumWatchdogSecurity, + types: + techVendorMaxRam: + }, + { + city: CityName.Chongqing, + name: LocationName.ChongqingKuaiGongInternational, + types: + techVendorMaxRam: + }, + { + city: CityName.Chongqing, + name: LocationName.ChongqingSolarisSpaceSystems, + types: + techVendorMaxRam: + }, + { + city: CityName.Ishima, + name: LocationName.IshimaNovaMedical, + types: + techVendorMaxRam: + }, + { + city: CityName.Ishima, + name: LocationName.IshimaOmegaSoftware, + types: + techVendorMaxRam: + }, + { + city: CityName.Ishima, + name: LocationName.IshimaStormTechnologies, + types: + techVendorMaxRam: + }, + { + city: CityName.NewTokyo, + name: LocationName.NewTokyoDefComm, + types: + techVendorMaxRam: + }, + { + city: CityName.NewTokyo, + name: LocationName.NewTokyoGlobalPharmaceuticals, + types: + techVendorMaxRam: + }, + { + city: CityName.NewTokyo, + name: LocationName.NewTokyoNoodleBar, + types: + techVendorMaxRam: + }, + { + city: CityName.NewTokyo, + name: LocationName.NewTokyoVitaLife, + types: + techVendorMaxRam: + }, + { + city: CityName.Sector12, + name: LocationName.Sector12AlphaEnterprises, + types: + techVendorMaxRam: + }, + { + city: CityName.Sector12, + name: LocationName.Sector12BladeIndustries, + types: + techVendorMaxRam: + }, + { + city: CityName.Sector12, + name: LocationName.Sector12CIA, + types: + techVendorMaxRam: + }, + { + city: CityName.Sector12, + name: LocationName.Sector12CarmichaelSecurity, + types: + techVendorMaxRam: + }, + { + city: CityName.Sector12, + name: LocationName.Sector12CityHall, + types: + techVendorMaxRam: + }, + { + city: CityName.Sector12, + name: LocationName.Sector12DeltaOne, + types: + techVendorMaxRam: + }, + { + city: CityName.Sector12, + name: LocationName.Sector12FoodNStuff, + types: + techVendorMaxRam: + }, + { + city: CityName.Sector12, + name: LocationName.Sector12FourSigma, + types: + techVendorMaxRam: + }, + { + city: CityName.Sector12, + name: LocationName.Sector12IcarusMicrosystems, + types: + techVendorMaxRam: + }, + { + city: CityName.Sector12, + name: LocationName.Sector12IronGym, + types: + techVendorMaxRam: + }, + { + city: CityName.Sector12, + name: LocationName.Sector12JoesGuns, + types: + techVendorMaxRam: + }, + { + city: CityName.Sector12, + name: LocationName.Sector12MegaCorp, + types: + techVendorMaxRam: + }, + { + city: CityName.Sector12, + name: LocationName.Sector12NSA, + types: + techVendorMaxRam: + }, + { + city: CityName.Sector12, + name: LocationName.Sector12PowerhouseGym, + types: + techVendorMaxRam: + }, + { + city: CityName.Sector12, + name: LocationName.Sector12RothmanUniversity, + types: + techVendorMaxRam: + }, + { + city: CityName.Sector12, + name: LocationName.Sector12UniversalEnergy, + types: + techVendorMaxRam: + }, + { + city: CityName.Volhaven, + name: LocationName.VolhavenCompuTek, + types: + techVendorMaxRam: + }, + { + city: CityName.Volhaven, + name: LocationName.VolhavenHeliosLabs, + types: + techVendorMaxRam: + }, + { + city: CityName.Volhaven, + name: LocationName.VolhavenLexoCorp, + types: + techVendorMaxRam: + }, + { + city: CityName.Volhaven, + name: LocationName.VolhavenMilleniumFitnessGym, + types: + techVendorMaxRam: + }, + { + city: CityName.Volhaven, + name: LocationName.VolhavenNWO, + types: + techVendorMaxRam: + }, + { + city: CityName.Volhaven, + name: LocationName.VolhavenOmniTekIncorporated, + types: + techVendorMaxRam: + }, + { + city: CityName.Volhaven, + name: LocationName.VolhavenOmniaCybersystems, + types: + techVendorMaxRam: + }, + { + city: CityName.Volhaven, + name: LocationName.VolhavenSysCoreSecurities, + types: + techVendorMaxRam: + }, + { + city: CityName.Volhaven, + name: LocationName.VolhavenZBInstituteOfTechnology, + types: + techVendorMaxRam: + }, + { + city: null, + name: LocationName.Hospital, + types: + techVendorMaxRam: + }, + { + city: null, + name: LocationName.Slums, + types: + techVendorMaxRam: + }, + { + city: null, + name: LocationName.TravelAgency, + types: + techVendorMaxRam: + }, + { + city: null, + name: LocationName.WorldStockExchange, + types: + techVendorMaxRam: + }, +]; diff --git a/src/PersonObjects/Person.ts b/src/PersonObjects/Person.ts index 9bc208a0a..d778989aa 100644 --- a/src/PersonObjects/Person.ts +++ b/src/PersonObjects/Person.ts @@ -3,7 +3,7 @@ import { Augmentation } from "../Augmentation/Augmentation"; import { Augmentations } from "../Augmentation/Augmentations"; import { IPlayerOwnedAugmentation } from "../Augmentation/PlayerOwnedAugmentation"; import { BitNodeMultipliers } from "../BitNode/BitNodeMultipliers"; -import { Cities } from "../Locations/Cities"; +import { CityName } from "../Locations/data/CityNames"; import { CONSTANTS } from "../Constants"; // Interface that defines a generic object used to track experience/money @@ -105,7 +105,7 @@ export abstract class Person { /** * City that the person is in */ - city: string = Cities.Sector12; + city: string = CityName.Sector12; constructor() {} diff --git a/src/PersonObjects/Sleeve/Sleeve.ts b/src/PersonObjects/Sleeve/Sleeve.ts index 8e644e2af..a8afb85b8 100644 --- a/src/PersonObjects/Sleeve/Sleeve.ts +++ b/src/PersonObjects/Sleeve/Sleeve.ts @@ -20,7 +20,7 @@ import { BitNodeMultipliers } from "../../BitNode/BitNodeMultipliers"; import { Crime } from "../../Crime/Crime"; import { Crimes } from "../../Crime/Crimes"; -import { Cities } from "../../Locations/Cities"; +import { CityName } from "../../Locations/data/CityNames"; import { Companies } from "../../Company/Companies"; import { Company } from "../../Company/Company"; @@ -547,19 +547,19 @@ export class Sleeve extends Person { let expMult: number = 1; switch (universityName.toLowerCase()) { case Locations.AevumSummitUniversity.toLowerCase(): - if (this.city !== Cities.Aevum) { return false; } + if (this.city !== CityName.Aevum) { return false; } this.currentTaskLocation = Locations.AevumSummitUniversity; costMult = 4; expMult = 3; break; case Locations.Sector12RothmanUniversity.toLowerCase(): - if (this.city !== Cities.Sector12) { return false; } + if (this.city !== CityName.Sector12) { return false; } this.currentTaskLocation = Locations.Sector12RothmanUniversity; costMult = 3; expMult = 2; break; case Locations.VolhavenZBInstituteOfTechnology.toLowerCase(): - if (this.city !== Cities.Volhaven) { return false; } + if (this.city !== CityName.Volhaven) { return false; } this.currentTaskLocation = Locations.VolhavenZBInstituteOfTechnology; costMult = 5; expMult = 4; @@ -613,7 +613,7 @@ export class Sleeve extends Person { * Travel to another City. Costs money from player */ travel(p: IPlayer, newCity: string): boolean { - if (Cities[newCity] == null) { + if (CityName[newCity] == null) { console.error(`Invalid city ${newCity} passed into Sleeve.travel()`); return false; } @@ -747,31 +747,31 @@ export class Sleeve extends Person { let expMult: number = 1; switch (gymName.toLowerCase()) { case Locations.AevumCrushFitnessGym.toLowerCase(): - if (this.city != Cities.Aevum) { return false; } + if (this.city != CityName.Aevum) { return false; } this.currentTaskLocation = Locations.AevumCrushFitnessGym; costMult = 3; expMult = 2; break; case Locations.AevumSnapFitnessGym.toLowerCase(): - if (this.city != Cities.Aevum) { return false; } + if (this.city != CityName.Aevum) { return false; } this.currentTaskLocation = Locations.AevumSnapFitnessGym; costMult = 10; expMult = 5; break; case Locations.Sector12IronGym.toLowerCase(): - if (this.city != Cities.Sector12) { return false; } + if (this.city != CityName.Sector12) { return false; } this.currentTaskLocation = Locations.Sector12IronGym; costMult = 1; expMult = 1; break; case Locations.Sector12PowerhouseGym.toLowerCase(): - if (this.city != Cities.Sector12) { return false; } + if (this.city != CityName.Sector12) { return false; } this.currentTaskLocation = Locations.Sector12PowerhouseGym; costMult = 20; expMult = 10; break; case Locations.VolhavenMilleniumFitnessGym: - if (this.city != Cities.Volhaven) { return false; } + if (this.city != CityName.Volhaven) { return false; } this.currentTaskLocation = Locations.VolhavenMilleniumFitnessGym; costMult = 7; expMult = 4;