Add More JavaDoc
All checks were successful
EnergonRelics/pipeline/head This commit looks good

This commit is contained in:
TheBrokenRail 2020-08-04 13:20:17 -04:00
parent b347a67a10
commit 14caa0f69a

View File

@ -54,11 +54,27 @@ public class Action {
* Action That Has Been Propagated * Action That Has Been Propagated
*/ */
public interface PropagatedAction { 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); void expandPayments(int amount);
/**
* Amount Required To Cause A Success State
* @return Energy Amount
*/
long amountOwed(); long amountOwed();
/**
* Pay Energy
* @param amount Energy Amount
*/
void pay(long amount); void pay(long amount);
} }
/**
* Simple Implementation Of A Propagated Action
*/
public static class PropagatedActionImpl implements PropagatedAction { public static class PropagatedActionImpl implements PropagatedAction {
private final Action action; private final Action action;
private final World world; private final World world;
@ -68,6 +84,13 @@ public class Action {
private int payments = 0; private int payments = 0;
private long amountPaid = 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) { public PropagatedActionImpl(Action action, World world, BlockPos pos, BlockState state) {
this.action = action; this.action = action;
this.world = world; this.world = world;