mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-22 17:23:00 +02:00
build bunch of fixes
This commit is contained in:
@@ -11,10 +11,6 @@
|
||||
* This formula ensures that the effects of the statistic that is being processed
|
||||
* has diminishing returns, but never loses its effectiveness as you continue
|
||||
* to raise it.
|
||||
*
|
||||
* There are two implementations of this component. One is simply a function that
|
||||
* can be called with the stat and the exponential/linear factors. The other is a
|
||||
* class where the exponential and linear factors are defined upon construction.
|
||||
*/
|
||||
export function calculateEffectWithFactors(n: number, expFac: number, linearFac: number): number {
|
||||
if (expFac <= 0 || expFac >= 1) {
|
||||
@@ -26,20 +22,3 @@ export function calculateEffectWithFactors(n: number, expFac: number, linearFac:
|
||||
|
||||
return Math.pow(n, expFac) + n / linearFac;
|
||||
}
|
||||
|
||||
export class EffectWithFactors {
|
||||
// Exponential factor
|
||||
private expFac: number;
|
||||
|
||||
// Linear Factor
|
||||
private linearFac: number;
|
||||
|
||||
constructor(expFac: number, linearFac: number) {
|
||||
this.expFac = expFac;
|
||||
this.linearFac = linearFac;
|
||||
}
|
||||
|
||||
calculate(n: number): number {
|
||||
return calculateEffectWithFactors(n, this.expFac, this.linearFac);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user