From b8d31091584fe9b859a1cf42a97a858d385e6540 Mon Sep 17 00:00:00 2001 From: catloversg <152669316+catloversg@users.noreply.github.com> Date: Wed, 29 May 2024 01:49:48 +0700 Subject: [PATCH] MISC: Change type of location parameter/property (#1316) --- markdown/bitburner.infiltration.getinfiltration.md | 4 ++-- markdown/bitburner.player.location.md | 2 +- markdown/bitburner.player.md | 2 +- markdown/bitburner.singularity.gotolocation.md | 4 ++-- markdown/bitburner.studytask.location.md | 2 +- markdown/bitburner.studytask.md | 2 +- markdown/bitburner.workformulas.gymgains.md | 4 ++-- markdown/bitburner.workformulas.universitygains.md | 4 ++-- src/ScriptEditor/NetscriptDefinitions.d.ts | 12 ++++++------ 9 files changed, 18 insertions(+), 18 deletions(-) diff --git a/markdown/bitburner.infiltration.getinfiltration.md b/markdown/bitburner.infiltration.getinfiltration.md index a553290bd..cfb19b535 100644 --- a/markdown/bitburner.infiltration.getinfiltration.md +++ b/markdown/bitburner.infiltration.getinfiltration.md @@ -9,14 +9,14 @@ Get all infiltrations with difficulty, location and rewards. **Signature:** ```typescript -getInfiltration(location: string): InfiltrationLocation; +getInfiltration(location: LocationName | `${LocationName}`): InfiltrationLocation; ``` ## Parameters | Parameter | Type | Description | | --- | --- | --- | -| location | string | | +| location | [LocationName](./bitburner.locationname.md) \| \`${[LocationName](./bitburner.locationname.md)}\` | | **Returns:** diff --git a/markdown/bitburner.player.location.md b/markdown/bitburner.player.location.md index abd704680..a88660821 100644 --- a/markdown/bitburner.player.location.md +++ b/markdown/bitburner.player.location.md @@ -7,5 +7,5 @@ **Signature:** ```typescript -location: string; +location: LocationName; ``` diff --git a/markdown/bitburner.player.md b/markdown/bitburner.player.md index 87cc06005..9a27dc91c 100644 --- a/markdown/bitburner.player.md +++ b/markdown/bitburner.player.md @@ -20,7 +20,7 @@ interface Player extends Person | [factions](./bitburner.player.factions.md) | | string\[\] | | | [jobs](./bitburner.player.jobs.md) | | Partial<Record<[CompanyName](./bitburner.companyname.md), [JobName](./bitburner.jobname.md)>> | | | [karma](./bitburner.player.karma.md) | | number | | -| [location](./bitburner.player.location.md) | | string | | +| [location](./bitburner.player.location.md) | | [LocationName](./bitburner.locationname.md) | | | [money](./bitburner.player.money.md) | | number | | | [numPeopleKilled](./bitburner.player.numpeoplekilled.md) | | number | | | [totalPlaytime](./bitburner.player.totalplaytime.md) | | number | | diff --git a/markdown/bitburner.singularity.gotolocation.md b/markdown/bitburner.singularity.gotolocation.md index e756edf39..63617ce6f 100644 --- a/markdown/bitburner.singularity.gotolocation.md +++ b/markdown/bitburner.singularity.gotolocation.md @@ -9,14 +9,14 @@ Go to a location. **Signature:** ```typescript -goToLocation(locationName: string): boolean; +goToLocation(locationName: LocationName | `${LocationName}`): boolean; ``` ## Parameters | Parameter | Type | Description | | --- | --- | --- | -| locationName | string | Name of the location. | +| locationName | [LocationName](./bitburner.locationname.md) \| \`${[LocationName](./bitburner.locationname.md)}\` | Name of the location. | **Returns:** diff --git a/markdown/bitburner.studytask.location.md b/markdown/bitburner.studytask.location.md index 387fd9b2f..6f474005d 100644 --- a/markdown/bitburner.studytask.location.md +++ b/markdown/bitburner.studytask.location.md @@ -7,5 +7,5 @@ **Signature:** ```typescript -location: string; +location: LocationName | `${LocationName}`; ``` diff --git a/markdown/bitburner.studytask.md b/markdown/bitburner.studytask.md index 2511b8f05..8dd663c9d 100644 --- a/markdown/bitburner.studytask.md +++ b/markdown/bitburner.studytask.md @@ -22,6 +22,6 @@ An object representing the current study task | --- | --- | --- | --- | | [classType](./bitburner.studytask.classtype.md) | | string | | | [cyclesWorked](./bitburner.studytask.cyclesworked.md) | | number | | -| [location](./bitburner.studytask.location.md) | | string | | +| [location](./bitburner.studytask.location.md) | | [LocationName](./bitburner.locationname.md) \| \`${[LocationName](./bitburner.locationname.md)}\` | | | [type](./bitburner.studytask.type.md) | | "CLASS" | | diff --git a/markdown/bitburner.workformulas.gymgains.md b/markdown/bitburner.workformulas.gymgains.md index 5bd0062e2..78097aa16 100644 --- a/markdown/bitburner.workformulas.gymgains.md +++ b/markdown/bitburner.workformulas.gymgains.md @@ -7,7 +7,7 @@ **Signature:** ```typescript -gymGains(person: Person, gymType: GymType | `${GymType}`, locationName: string): WorkStats; +gymGains(person: Person, gymType: GymType | `${GymType}`, locationName: LocationName | `${LocationName}`): WorkStats; ``` ## Parameters @@ -16,7 +16,7 @@ gymGains(person: Person, gymType: GymType | `${GymType}`, locationName: string): | --- | --- | --- | | person | [Person](./bitburner.person.md) | | | gymType | [GymType](./bitburner.gymtype.md) \| \`${[GymType](./bitburner.gymtype.md)}\` | | -| locationName | string | | +| locationName | [LocationName](./bitburner.locationname.md) \| \`${[LocationName](./bitburner.locationname.md)}\` | | **Returns:** diff --git a/markdown/bitburner.workformulas.universitygains.md b/markdown/bitburner.workformulas.universitygains.md index 444a90865..dfd82ede0 100644 --- a/markdown/bitburner.workformulas.universitygains.md +++ b/markdown/bitburner.workformulas.universitygains.md @@ -10,7 +10,7 @@ universityGains( person: Person, classType: UniversityClassType | `${UniversityClassType}`, - locationName: string, + locationName: LocationName | `${LocationName}`, ): WorkStats; ``` @@ -20,7 +20,7 @@ universityGains( | --- | --- | --- | | person | [Person](./bitburner.person.md) | | | classType | [UniversityClassType](./bitburner.universityclasstype.md) \| \`${[UniversityClassType](./bitburner.universityclasstype.md)}\` | | -| locationName | string | | +| locationName | [LocationName](./bitburner.locationname.md) \| \`${[LocationName](./bitburner.locationname.md)}\` | | **Returns:** diff --git a/src/ScriptEditor/NetscriptDefinitions.d.ts b/src/ScriptEditor/NetscriptDefinitions.d.ts index 1cfde0d1c..bf9263925 100644 --- a/src/ScriptEditor/NetscriptDefinitions.d.ts +++ b/src/ScriptEditor/NetscriptDefinitions.d.ts @@ -47,7 +47,7 @@ interface Player extends Person { jobs: Partial>; factions: string[]; totalPlaytime: number; - location: string; + location: LocationName; karma: number; } @@ -1611,7 +1611,7 @@ export interface StudyTask { type: "CLASS"; cyclesWorked: number; classType: string; - location: string; + location: LocationName | `${LocationName}`; } /** * Company Work @@ -2464,7 +2464,7 @@ export interface Singularity { * @param locationName - Name of the location. * @returns True if the player was moved there, false otherwise. */ - goToLocation(locationName: string): boolean; + goToLocation(locationName: LocationName | `${LocationName}`): boolean; /** * Get the current server. @@ -4663,12 +4663,12 @@ interface WorkFormulas { /** @returns The WorkStats gained when completing one instance of the specified crime. */ crimeGains(person: Person, crimeType: CrimeType | `${CrimeType}`): WorkStats; /** @returns The WorkStats applied every game cycle (200ms) by taking the specified gym class. */ - gymGains(person: Person, gymType: GymType | `${GymType}`, locationName: string): WorkStats; + gymGains(person: Person, gymType: GymType | `${GymType}`, locationName: LocationName | `${LocationName}`): WorkStats; /** @returns The WorkStats applied every game cycle (200ms) by taking the specified university class. */ universityGains( person: Person, classType: UniversityClassType | `${UniversityClassType}`, - locationName: string, + locationName: LocationName | `${LocationName}`, ): WorkStats; /** @returns The WorkStats applied every game cycle (200ms) by performing the specified faction work. */ factionGains(person: Person, workType: FactionWorkType | `${FactionWorkType}`, favor: number): WorkStats; @@ -5185,7 +5185,7 @@ interface Infiltration { * * @returns Infiltration data for given location. */ - getInfiltration(location: string): InfiltrationLocation; + getInfiltration(location: LocationName | `${LocationName}`): InfiltrationLocation; } /**