Add flat taxing to PowerHandler for King Lemming
This should be a non-breaking API change.
This commit is contained in:
parent
a52437b618
commit
6c76a9a8d6
1 changed files with 13 additions and 0 deletions
|
@ -82,6 +82,17 @@ public final class PowerHandler {
|
||||||
}
|
}
|
||||||
return current;
|
return current;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Taxes a flat rate on all incoming power.
|
||||||
|
*
|
||||||
|
* Defaults to 0% tax rate.
|
||||||
|
*
|
||||||
|
* @return percent of input to tax
|
||||||
|
*/
|
||||||
|
public float getTaxPercent() {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
public static final PerditionCalculator DEFAULT_PERDITION = new PerditionCalculator();
|
public static final PerditionCalculator DEFAULT_PERDITION = new PerditionCalculator();
|
||||||
private float minEnergyReceived;
|
private float minEnergyReceived;
|
||||||
|
@ -347,6 +358,8 @@ public final class PowerHandler {
|
||||||
}
|
}
|
||||||
|
|
||||||
updateSources(from);
|
updateSources(from);
|
||||||
|
|
||||||
|
used -= used * getPerdition().getTaxPercent();
|
||||||
|
|
||||||
used = addEnergy(used);
|
used = addEnergy(used);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue