mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-22 01:03:01 +02:00
Use wasted hashes on "Sell for Money"
This commit is contained in:
@@ -113,9 +113,17 @@ export class HashManager {
|
||||
this.hashes += cost;
|
||||
}
|
||||
|
||||
storeHashes(numHashes: number): void {
|
||||
/**
|
||||
* Stores the given hashes, capping at capacity
|
||||
* @param numHashes The number of hashes to increment
|
||||
* @returns The number of wasted hashes (over capacity)
|
||||
*/
|
||||
storeHashes(numHashes: number): number {
|
||||
this.hashes += numHashes;
|
||||
let wastedHashes = this.hashes;
|
||||
this.hashes = Math.min(this.hashes, this.capacity);
|
||||
wastedHashes -= this.hashes;
|
||||
return wastedHashes;
|
||||
}
|
||||
|
||||
updateCapacity(newCap: number): void {
|
||||
|
||||
Reference in New Issue
Block a user