From 14caa0f69ab36247c0f37dc5e84d1da4da7d39fe Mon Sep 17 00:00:00 2001 From: TheBrokenRail Date: Tue, 4 Aug 2020 13:20:17 -0400 Subject: [PATCH] Add More JavaDoc --- .../energonrelics/api/energy/Action.java | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/main/java/com/thebrokenrail/energonrelics/api/energy/Action.java b/src/main/java/com/thebrokenrail/energonrelics/api/energy/Action.java index 73ca7de..612673a 100644 --- a/src/main/java/com/thebrokenrail/energonrelics/api/energy/Action.java +++ b/src/main/java/com/thebrokenrail/energonrelics/api/energy/Action.java @@ -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;