1 package net.mograsim.logic.model.snippets.highlevelstatehandlers.standard.subcomponent;
3 import java.util.function.Consumer;
5 import com.google.gson.JsonElement;
7 import net.mograsim.logic.model.serializing.JSONSerializable;
8 import net.mograsim.logic.model.snippets.HighLevelStateHandler;
10 public interface SubcomponentHighLevelStateHandler extends JSONSerializable
13 * Gets the current value of the given high level state of the subcomponent represented by this SubcomponentHighLevelStateHandler.<br>
14 * See {@link HighLevelStateHandler} for an explanation of high-level state IDs.
16 * @author Daniel Kirschten
18 public Object getHighLevelState(String subStateID);
21 * Sets the given high level state of the subcomponent represented by this SubcomponentHighLevelStateHandler to the given value.<br>
22 * See {@link HighLevelStateHandler} for an explanation of high-level state IDs.
24 * @author Daniel Kirschten
26 public void setHighLevelState(String subStateID, Object newState);
28 public static class SubcomponentHighLevelStateHandlerParams
31 public JsonElement params;
34 public void addListener(String subStateID, Consumer<Object> stateChanged);
36 public void removeListener(String subStateID, Consumer<Object> stateChanged);