17 lines
471 B
Java
17 lines
471 B
Java
|
package com.thebrokenrail.energonrelics.energy.helper;
|
||
|
|
||
|
import com.thebrokenrail.energonrelics.energy.core.util.Action;
|
||
|
|
||
|
public interface EnergyGenerator {
|
||
|
default void handlePropagatedActionWithGenerator(Action.PropagatedAction action) {
|
||
|
long amount = Math.min(getEnergy(), action.amountOwed());
|
||
|
setEnergy(getEnergy() - amount);
|
||
|
action.pay(amount);
|
||
|
}
|
||
|
|
||
|
long getEnergy();
|
||
|
void setEnergy(long value);
|
||
|
|
||
|
long getDisplayEnergy();
|
||
|
}
|