GRAFTING: Add new api for checking ongoing grafting (#1435)

This commit is contained in:
catloversg
2024-06-29 09:59:18 +07:00
committed by GitHub
parent 32eb6324fd
commit b1c1fc24a9
10 changed files with 97 additions and 10 deletions

View File

@@ -4,7 +4,7 @@
## Grafting.getAugmentationGraftTime() method
Retrieves the time required to graft an aug.
Retrieves the time required to graft an aug. Do not use this value to determine when the ongoing grafting finishes. The ongoing grafting is affected by current intelligence level and focus bonus. You should use [waitForOngoingGrafting](./bitburner.grafting.waitforongoinggrafting.md) for that purpose.
**Signature:**
@@ -22,7 +22,7 @@ getAugmentationGraftTime(augName: string): number;
number
The time required, in millis, to graft the named augmentation.
The time required, in milliseconds, to graft the named augmentation.
## Exceptions

View File

@@ -4,7 +4,7 @@
## Grafting.graftAugmentation() method
Begins grafting the named aug. You must be in New Tokyo to use this.
Begins grafting the named aug. You must be in New Tokyo to use this. When you call this API, the current work (grafting or other actions) will be canceled.
**Signature:**

View File

@@ -21,7 +21,8 @@ This API requires Source-File 10 to use.
| Method | Description |
| --- | --- |
| [getAugmentationGraftPrice(augName)](./bitburner.grafting.getaugmentationgraftprice.md) | Retrieve the grafting cost of an aug. |
| [getAugmentationGraftTime(augName)](./bitburner.grafting.getaugmentationgrafttime.md) | Retrieves the time required to graft an aug. |
| [getAugmentationGraftTime(augName)](./bitburner.grafting.getaugmentationgrafttime.md) | Retrieves the time required to graft an aug. Do not use this value to determine when the ongoing grafting finishes. The ongoing grafting is affected by current intelligence level and focus bonus. You should use [waitForOngoingGrafting](./bitburner.grafting.waitforongoinggrafting.md) for that purpose. |
| [getGraftableAugmentations()](./bitburner.grafting.getgraftableaugmentations.md) | Retrieves a list of Augmentations that can be grafted. |
| [graftAugmentation(augName, focus)](./bitburner.grafting.graftaugmentation.md) | Begins grafting the named aug. You must be in New Tokyo to use this. |
| [graftAugmentation(augName, focus)](./bitburner.grafting.graftaugmentation.md) | Begins grafting the named aug. You must be in New Tokyo to use this. When you call this API, the current work (grafting or other actions) will be canceled. |
| [waitForOngoingGrafting()](./bitburner.grafting.waitforongoinggrafting.md) | Wait until the ongoing grafting finishes or is canceled. |

View File

@@ -0,0 +1,23 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [Grafting](./bitburner.grafting.md) &gt; [waitForOngoingGrafting](./bitburner.grafting.waitforongoinggrafting.md)
## Grafting.waitForOngoingGrafting() method
Wait until the ongoing grafting finishes or is canceled.
**Signature:**
```typescript
waitForOngoingGrafting(): Promise<void>;
```
**Returns:**
Promise&lt;void&gt;
A promise that resolves when the current grafting finishes or is canceled. If there is no current work, the promise resolves immediately. If the current work is not a grafting work, the promise rejects immediately.
## Remarks
RAM cost: 1 GB

View File

@@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [GraftingTask](./bitburner.graftingtask.md) &gt; [completion](./bitburner.graftingtask.completion.md)
## GraftingTask.completion property
**Signature:**
```typescript
completion: Promise<void>;
```

View File

@@ -21,6 +21,7 @@ An object representing the current grafting status
| Property | Modifiers | Type | Description |
| --- | --- | --- | --- |
| [augmentation](./bitburner.graftingtask.augmentation.md) | | string | |
| [completion](./bitburner.graftingtask.completion.md) | | Promise&lt;void&gt; | |
| [cyclesWorked](./bitburner.graftingtask.cyclesworked.md) | | number | |
| [type](./bitburner.graftingtask.type.md) | | "GRAFTING" | |