mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-08 08:43:53 +01:00
MISC: Change type of location parameter/property (#1316)
This commit is contained in:
parent
bed66f980f
commit
b8d3109158
@ -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:**
|
||||
|
||||
|
@ -7,5 +7,5 @@
|
||||
**Signature:**
|
||||
|
||||
```typescript
|
||||
location: string;
|
||||
location: LocationName;
|
||||
```
|
||||
|
@ -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 | |
|
||||
|
@ -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:**
|
||||
|
||||
|
@ -7,5 +7,5 @@
|
||||
**Signature:**
|
||||
|
||||
```typescript
|
||||
location: string;
|
||||
location: LocationName | `${LocationName}`;
|
||||
```
|
||||
|
@ -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" | |
|
||||
|
||||
|
@ -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:**
|
||||
|
||||
|
@ -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:**
|
||||
|
||||
|
12
src/ScriptEditor/NetscriptDefinitions.d.ts
vendored
12
src/ScriptEditor/NetscriptDefinitions.d.ts
vendored
@ -47,7 +47,7 @@ interface Player extends Person {
|
||||
jobs: Partial<Record<CompanyName, JobName>>;
|
||||
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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user