Add More JavaDoc
EnergonRelics/pipeline/head This commit looks good Details

This commit is contained in:
TheBrokenRail 2020-08-04 13:20:17 -04:00
parent b347a67a10
commit 14caa0f69a
1 changed files with 23 additions and 0 deletions

View File

@ -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;