This commit is contained in:
parent
b347a67a10
commit
14caa0f69a
@ -54,11 +54,27 @@ public class Action {
|
||||
* Action That Has Been Propagated
|
||||
*/
|
||||
public interface PropagatedAction {
|
||||
/**
|
||||
* Propagated Actions Track The Amount Of Payments Expected So They Know When All Payments Have Been Processed And Can Execute A Fail State If Needed
|
||||
* This Method Expands The Amount Of Payments Expected
|
||||
* @param amount Amount To Expand By
|
||||
*/
|
||||
void expandPayments(int amount);
|
||||
/**
|
||||
* Amount Required To Cause A Success State
|
||||
* @return Energy Amount
|
||||
*/
|
||||
long amountOwed();
|
||||
/**
|
||||
* Pay Energy
|
||||
* @param amount Energy Amount
|
||||
*/
|
||||
void pay(long amount);
|
||||
}
|
||||
|
||||
/**
|
||||
* Simple Implementation Of A Propagated Action
|
||||
*/
|
||||
public static class PropagatedActionImpl implements PropagatedAction {
|
||||
private final Action action;
|
||||
private final World world;
|
||||
@ -68,6 +84,13 @@ public class Action {
|
||||
private int payments = 0;
|
||||
private long amountPaid = 0;
|
||||
|
||||
/**
|
||||
* Create Propagated Action
|
||||
* @param action Action
|
||||
* @param world World
|
||||
* @param pos Position
|
||||
* @param state Block State
|
||||
*/
|
||||
public PropagatedActionImpl(Action action, World world, BlockPos pos, BlockState state) {
|
||||
this.action = action;
|
||||
this.world = world;
|
||||
|
Reference in New Issue
Block a user