mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-08 16:53:54 +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:**
|
**Signature:**
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
getInfiltration(location: string): InfiltrationLocation;
|
getInfiltration(location: LocationName | `${LocationName}`): InfiltrationLocation;
|
||||||
```
|
```
|
||||||
|
|
||||||
## Parameters
|
## Parameters
|
||||||
|
|
||||||
| Parameter | Type | Description |
|
| Parameter | Type | Description |
|
||||||
| --- | --- | --- |
|
| --- | --- | --- |
|
||||||
| location | string | |
|
| location | [LocationName](./bitburner.locationname.md) \| \`${[LocationName](./bitburner.locationname.md)<!-- -->}\` | |
|
||||||
|
|
||||||
**Returns:**
|
**Returns:**
|
||||||
|
|
||||||
|
@ -7,5 +7,5 @@
|
|||||||
**Signature:**
|
**Signature:**
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
location: string;
|
location: LocationName;
|
||||||
```
|
```
|
||||||
|
@ -20,7 +20,7 @@ interface Player extends Person
|
|||||||
| [factions](./bitburner.player.factions.md) | | string\[\] | |
|
| [factions](./bitburner.player.factions.md) | | string\[\] | |
|
||||||
| [jobs](./bitburner.player.jobs.md) | | Partial<Record<[CompanyName](./bitburner.companyname.md)<!-- -->, [JobName](./bitburner.jobname.md)<!-- -->>> | |
|
| [jobs](./bitburner.player.jobs.md) | | Partial<Record<[CompanyName](./bitburner.companyname.md)<!-- -->, [JobName](./bitburner.jobname.md)<!-- -->>> | |
|
||||||
| [karma](./bitburner.player.karma.md) | | number | |
|
| [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 | |
|
| [money](./bitburner.player.money.md) | | number | |
|
||||||
| [numPeopleKilled](./bitburner.player.numpeoplekilled.md) | | number | |
|
| [numPeopleKilled](./bitburner.player.numpeoplekilled.md) | | number | |
|
||||||
| [totalPlaytime](./bitburner.player.totalplaytime.md) | | number | |
|
| [totalPlaytime](./bitburner.player.totalplaytime.md) | | number | |
|
||||||
|
@ -9,14 +9,14 @@ Go to a location.
|
|||||||
**Signature:**
|
**Signature:**
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
goToLocation(locationName: string): boolean;
|
goToLocation(locationName: LocationName | `${LocationName}`): boolean;
|
||||||
```
|
```
|
||||||
|
|
||||||
## Parameters
|
## Parameters
|
||||||
|
|
||||||
| Parameter | Type | Description |
|
| Parameter | Type | Description |
|
||||||
| --- | --- | --- |
|
| --- | --- | --- |
|
||||||
| locationName | string | Name of the location. |
|
| locationName | [LocationName](./bitburner.locationname.md) \| \`${[LocationName](./bitburner.locationname.md)<!-- -->}\` | Name of the location. |
|
||||||
|
|
||||||
**Returns:**
|
**Returns:**
|
||||||
|
|
||||||
|
@ -7,5 +7,5 @@
|
|||||||
**Signature:**
|
**Signature:**
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
location: string;
|
location: LocationName | `${LocationName}`;
|
||||||
```
|
```
|
||||||
|
@ -22,6 +22,6 @@ An object representing the current study task
|
|||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- |
|
||||||
| [classType](./bitburner.studytask.classtype.md) | | string | |
|
| [classType](./bitburner.studytask.classtype.md) | | string | |
|
||||||
| [cyclesWorked](./bitburner.studytask.cyclesworked.md) | | number | |
|
| [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" | |
|
| [type](./bitburner.studytask.type.md) | | "CLASS" | |
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
**Signature:**
|
**Signature:**
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
gymGains(person: Person, gymType: GymType | `${GymType}`, locationName: string): WorkStats;
|
gymGains(person: Person, gymType: GymType | `${GymType}`, locationName: LocationName | `${LocationName}`): WorkStats;
|
||||||
```
|
```
|
||||||
|
|
||||||
## Parameters
|
## Parameters
|
||||||
@ -16,7 +16,7 @@ gymGains(person: Person, gymType: GymType | `${GymType}`, locationName: string):
|
|||||||
| --- | --- | --- |
|
| --- | --- | --- |
|
||||||
| person | [Person](./bitburner.person.md) | |
|
| person | [Person](./bitburner.person.md) | |
|
||||||
| gymType | [GymType](./bitburner.gymtype.md) \| \`${[GymType](./bitburner.gymtype.md)<!-- -->}\` | |
|
| gymType | [GymType](./bitburner.gymtype.md) \| \`${[GymType](./bitburner.gymtype.md)<!-- -->}\` | |
|
||||||
| locationName | string | |
|
| locationName | [LocationName](./bitburner.locationname.md) \| \`${[LocationName](./bitburner.locationname.md)<!-- -->}\` | |
|
||||||
|
|
||||||
**Returns:**
|
**Returns:**
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
universityGains(
|
universityGains(
|
||||||
person: Person,
|
person: Person,
|
||||||
classType: UniversityClassType | `${UniversityClassType}`,
|
classType: UniversityClassType | `${UniversityClassType}`,
|
||||||
locationName: string,
|
locationName: LocationName | `${LocationName}`,
|
||||||
): WorkStats;
|
): WorkStats;
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -20,7 +20,7 @@ universityGains(
|
|||||||
| --- | --- | --- |
|
| --- | --- | --- |
|
||||||
| person | [Person](./bitburner.person.md) | |
|
| person | [Person](./bitburner.person.md) | |
|
||||||
| classType | [UniversityClassType](./bitburner.universityclasstype.md) \| \`${[UniversityClassType](./bitburner.universityclasstype.md)<!-- -->}\` | |
|
| classType | [UniversityClassType](./bitburner.universityclasstype.md) \| \`${[UniversityClassType](./bitburner.universityclasstype.md)<!-- -->}\` | |
|
||||||
| locationName | string | |
|
| locationName | [LocationName](./bitburner.locationname.md) \| \`${[LocationName](./bitburner.locationname.md)<!-- -->}\` | |
|
||||||
|
|
||||||
**Returns:**
|
**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>>;
|
jobs: Partial<Record<CompanyName, JobName>>;
|
||||||
factions: string[];
|
factions: string[];
|
||||||
totalPlaytime: number;
|
totalPlaytime: number;
|
||||||
location: string;
|
location: LocationName;
|
||||||
karma: number;
|
karma: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1611,7 +1611,7 @@ export interface StudyTask {
|
|||||||
type: "CLASS";
|
type: "CLASS";
|
||||||
cyclesWorked: number;
|
cyclesWorked: number;
|
||||||
classType: string;
|
classType: string;
|
||||||
location: string;
|
location: LocationName | `${LocationName}`;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Company Work
|
* Company Work
|
||||||
@ -2464,7 +2464,7 @@ export interface Singularity {
|
|||||||
* @param locationName - Name of the location.
|
* @param locationName - Name of the location.
|
||||||
* @returns True if the player was moved there, false otherwise.
|
* @returns True if the player was moved there, false otherwise.
|
||||||
*/
|
*/
|
||||||
goToLocation(locationName: string): boolean;
|
goToLocation(locationName: LocationName | `${LocationName}`): boolean;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the current server.
|
* Get the current server.
|
||||||
@ -4663,12 +4663,12 @@ interface WorkFormulas {
|
|||||||
/** @returns The WorkStats gained when completing one instance of the specified crime. */
|
/** @returns The WorkStats gained when completing one instance of the specified crime. */
|
||||||
crimeGains(person: Person, crimeType: CrimeType | `${CrimeType}`): WorkStats;
|
crimeGains(person: Person, crimeType: CrimeType | `${CrimeType}`): WorkStats;
|
||||||
/** @returns The WorkStats applied every game cycle (200ms) by taking the specified gym class. */
|
/** @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. */
|
/** @returns The WorkStats applied every game cycle (200ms) by taking the specified university class. */
|
||||||
universityGains(
|
universityGains(
|
||||||
person: Person,
|
person: Person,
|
||||||
classType: UniversityClassType | `${UniversityClassType}`,
|
classType: UniversityClassType | `${UniversityClassType}`,
|
||||||
locationName: string,
|
locationName: LocationName | `${LocationName}`,
|
||||||
): WorkStats;
|
): WorkStats;
|
||||||
/** @returns The WorkStats applied every game cycle (200ms) by performing the specified faction work. */
|
/** @returns The WorkStats applied every game cycle (200ms) by performing the specified faction work. */
|
||||||
factionGains(person: Person, workType: FactionWorkType | `${FactionWorkType}`, favor: number): WorkStats;
|
factionGains(person: Person, workType: FactionWorkType | `${FactionWorkType}`, favor: number): WorkStats;
|
||||||
@ -5185,7 +5185,7 @@ interface Infiltration {
|
|||||||
*
|
*
|
||||||
* @returns Infiltration data for given location.
|
* @returns Infiltration data for given location.
|
||||||
*/
|
*/
|
||||||
getInfiltration(location: string): InfiltrationLocation;
|
getInfiltration(location: LocationName | `${LocationName}`): InfiltrationLocation;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user