bitburner-official / bitburner-src

Bitburner source code.
Other
688 stars 232 forks source link

GRAFTING: Add new api for checking ongoing grafting #1435

Closed catloversg closed 1 week ago

catloversg commented 1 week ago

This PR implements d0sboots's suggestion in #1027.

Closes #1012.

d0sboots commented 1 week ago

I'm going to bring up one potential quibble, before this gets locked in stone: Should it reject if the current work is not grafting work?

I can see arguments both ways - on one hand, many players won't be coding to handle promise rejections, but on the other hand, maybe that's a good thing, since if a different type of work is happening, that should be an exceptional case. (I would leave "no work" as an instant resolve.)

catloversg commented 1 week ago

Should it reject if the current work is not grafting work?

It makes sense. I considered that behavior at first, but scraped that idea because many people don't like exception/promise rejection.