2019-03-27 09:31:47 +01:00
|
|
|
/**
|
|
|
|
* Class representing a visitable location in the world
|
|
|
|
*/
|
|
|
|
import { CityName } from "./data/CityNames";
|
|
|
|
import { LocationName } from "./data/LocationNames";
|
|
|
|
import { LocationType } from "./LocationTypeEnum";
|
|
|
|
|
2019-04-01 11:23:25 +02:00
|
|
|
interface IInfiltrationMetadata {
|
|
|
|
baseRewardValue: number;
|
|
|
|
difficulty: number;
|
|
|
|
maxClearanceLevel: number;
|
|
|
|
startingSecurityLevel: number;
|
|
|
|
}
|
|
|
|
|
2019-03-27 09:31:47 +01:00
|
|
|
export interface IConstructorParams {
|
|
|
|
city?: CityName | null;
|
2019-04-01 11:23:25 +02:00
|
|
|
costMult?: number;
|
|
|
|
expMult?: number;
|
|
|
|
infiltrationData?: IInfiltrationMetadata;
|
2019-03-27 09:31:47 +01:00
|
|
|
name?: LocationName;
|
|
|
|
types?: LocationType[];
|
|
|
|
techVendorMaxRam?: number;
|
2019-03-29 08:12:41 +01:00
|
|
|
techVendorMinRam?: number;
|
2019-03-27 09:31:47 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
export class Location {
|
2019-03-29 08:12:41 +01:00
|
|
|
/**
|
|
|
|
* Name of city this location is in. If this property is null, it means this i
|
|
|
|
* is a generic location that is available in all cities
|
|
|
|
*/
|
2019-03-27 09:31:47 +01:00
|
|
|
city: CityName | null = null;
|
|
|
|
|
2019-04-01 11:23:25 +02:00
|
|
|
/**
|
|
|
|
* Cost multiplier that influences how expensive a gym/university is
|
|
|
|
*/
|
2021-04-30 05:52:56 +02:00
|
|
|
costMult = 0;
|
2019-04-01 11:23:25 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Exp multiplier that influences how effective a gym/university is
|
|
|
|
*/
|
2021-04-30 05:52:56 +02:00
|
|
|
expMult = 0;
|
2019-04-01 11:23:25 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Companies can be infiltrated. This contains the data required for that
|
|
|
|
* infiltration event
|
|
|
|
*/
|
|
|
|
infiltrationData?: IInfiltrationMetadata;
|
|
|
|
|
2019-03-29 08:12:41 +01:00
|
|
|
/**
|
|
|
|
* Identifier for location
|
|
|
|
*/
|
2019-03-27 09:31:47 +01:00
|
|
|
name: LocationName = LocationName.Void;
|
|
|
|
|
2019-03-29 08:12:41 +01:00
|
|
|
/**
|
|
|
|
* List of what type(s) this location is. A location can be multiple types
|
|
|
|
* (e.g. company and tech vendor)
|
|
|
|
*/
|
2019-03-27 09:31:47 +01:00
|
|
|
types: LocationType[] = [];
|
|
|
|
|
2019-03-29 08:12:41 +01:00
|
|
|
/**
|
|
|
|
* Tech vendors allow you to purchase servers.
|
|
|
|
* This property defines the max RAM server you can purchase from this vendor
|
|
|
|
*/
|
2021-04-30 05:52:56 +02:00
|
|
|
techVendorMaxRam = 0;
|
2019-03-27 09:31:47 +01:00
|
|
|
|
2019-03-29 08:12:41 +01:00
|
|
|
/**
|
|
|
|
* Tech vendors allow you to purchase servers.
|
|
|
|
* This property defines the max RAM server you can purchase from this vendor
|
|
|
|
*/
|
2021-04-30 05:52:56 +02:00
|
|
|
techVendorMinRam = 0;
|
2019-03-29 08:12:41 +01:00
|
|
|
|
2019-03-27 09:31:47 +01:00
|
|
|
constructor(p: IConstructorParams) {
|
|
|
|
if (p.city) { this.city = p.city; }
|
2019-04-01 11:23:25 +02:00
|
|
|
if (p.costMult) { this.costMult = p.costMult; }
|
|
|
|
if (p.expMult) { this.expMult = p.expMult; }
|
|
|
|
if (p.infiltrationData) { this.infiltrationData = p.infiltrationData; }
|
2019-03-27 09:31:47 +01:00
|
|
|
if (p.name) { this.name = p.name; }
|
|
|
|
if (p.types) { this.types = p.types; }
|
|
|
|
if (p.techVendorMaxRam) { this.techVendorMaxRam = p.techVendorMaxRam; }
|
2019-03-29 08:12:41 +01:00
|
|
|
if (p.techVendorMinRam) { this.techVendorMinRam = p.techVendorMinRam; }
|
2019-03-27 09:31:47 +01:00
|
|
|
}
|
|
|
|
}
|