Add flat taxing to PowerHandler for King Lemming

This should be a non-breaking API change.
This commit is contained in:
CovertJaguar 2013-09-24 08:49:48 -07:00
parent a52437b618
commit 6c76a9a8d6

View file

@ -82,6 +82,17 @@ public final class PowerHandler {
}
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();
private float minEnergyReceived;
@ -347,6 +358,8 @@ public final class PowerHandler {
}
updateSources(from);
used -= used * getPerdition().getTaxPercent();
used = addEnergy(used);