mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-05-22 15:42:05 +02:00
Finished location code refactor. Has not yet been tested
This commit is contained in:
@@ -5,8 +5,18 @@ import { CityName } from "./data/CityNames";
|
||||
import { LocationName } from "./data/LocationNames";
|
||||
import { LocationType } from "./LocationTypeEnum";
|
||||
|
||||
interface IInfiltrationMetadata {
|
||||
baseRewardValue: number;
|
||||
difficulty: number;
|
||||
maxClearanceLevel: number;
|
||||
startingSecurityLevel: number;
|
||||
}
|
||||
|
||||
export interface IConstructorParams {
|
||||
city?: CityName | null;
|
||||
costMult?: number;
|
||||
expMult?: number;
|
||||
infiltrationData?: IInfiltrationMetadata;
|
||||
name?: LocationName;
|
||||
types?: LocationType[];
|
||||
techVendorMaxRam?: number;
|
||||
@@ -20,6 +30,22 @@ export class Location {
|
||||
*/
|
||||
city: CityName | null = null;
|
||||
|
||||
/**
|
||||
* Cost multiplier that influences how expensive a gym/university is
|
||||
*/
|
||||
costMult: number = 0;
|
||||
|
||||
/**
|
||||
* Exp multiplier that influences how effective a gym/university is
|
||||
*/
|
||||
expMult: number = 0;
|
||||
|
||||
/**
|
||||
* Companies can be infiltrated. This contains the data required for that
|
||||
* infiltration event
|
||||
*/
|
||||
infiltrationData?: IInfiltrationMetadata;
|
||||
|
||||
/**
|
||||
* Identifier for location
|
||||
*/
|
||||
@@ -45,6 +71,9 @@ export class Location {
|
||||
|
||||
constructor(p: IConstructorParams) {
|
||||
if (p.city) { this.city = p.city; }
|
||||
if (p.costMult) { this.costMult = p.costMult; }
|
||||
if (p.expMult) { this.expMult = p.expMult; }
|
||||
if (p.infiltrationData) { this.infiltrationData = p.infiltrationData; }
|
||||
if (p.name) { this.name = p.name; }
|
||||
if (p.types) { this.types = p.types; }
|
||||
if (p.techVendorMaxRam) { this.techVendorMaxRam = p.techVendorMaxRam; }
|
||||
|
||||
Reference in New Issue
Block a user