Class Connector
java.lang.Object
group24.escaperoom.entities.properties.ItemProperty<PhantomProperty.PhantomPropertyValue>
group24.escaperoom.entities.properties.PhantomProperty
group24.escaperoom.entities.properties.Connector
- All Implemented Interfaces:
com.badlogic.gdx.utils.Json.Serializable,Connectable
- Direct Known Subclasses:
ConnectorBridge,ConnectorRelay,ConnectorSink,ConnectorSource
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class group24.escaperoom.entities.properties.PhantomProperty
PhantomProperty.PhantomPropertyValueNested classes/interfaces inherited from class group24.escaperoom.entities.properties.ItemProperty
ItemProperty.MenuTypeNested classes/interfaces inherited from interface group24.escaperoom.entities.properties.Connectable
Connectable.ConnectableItem, Connectable.Utils -
Field Summary
FieldsFields inherited from class group24.escaperoom.entities.properties.ItemProperty
ownerFields inherited from interface group24.escaperoom.entities.properties.Connectable
defaultConnectionDirections -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidacceptSignalFrom(Connectable source, Types.IntVector2 position, GameContext ctx, HashSet<Integer> seen) Called when thisConnectablereceives a signal from another.Get the type of connector.Get aPropertyConfigurationthat contains all fields necessary to configure this property in theItemEditorgetType()booleanGet whether or not this Connectable is connected (active)voidpropagate(GameContext ctx, HashSet<Integer> seen) Potentially propagate the the connectors current siganlvoidread(com.badlogic.gdx.utils.Json json, com.badlogic.gdx.utils.JsonValue jsonData) voidsetActive(boolean connected, GameContext ctx) Set theConnectableto beconnectedThis may or may not propagate the signalprotected voidvoidwrite(com.badlogic.gdx.utils.Json json) Methods inherited from class group24.escaperoom.entities.properties.PhantomProperty
getAvailableActions, getInputType, getPotentialValues, getValueClassMethods inherited from class group24.escaperoom.entities.properties.ItemProperty
apply, cloneProperty, defaultConfiguration, getActions, getCurrentValue, getCurrentValues, getOwner, getPopOut, set, set, setOwner, unsafeSet, unsafeSet, updateTextureMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface group24.escaperoom.entities.properties.Connectable
connectionDirections
-
Field Details
-
type
-
connected
protected boolean connected
-
-
Constructor Details
-
Connector
public Connector()
-
-
Method Details
-
getDescription
- Specified by:
getDescriptionin classItemProperty<PhantomProperty.PhantomPropertyValue>- Returns:
- the
PropertyDescriptionof this Property
-
getConnectorType
Description copied from interface:ConnectableGet the type of connector.- Specified by:
getConnectorTypein interfaceConnectable
-
propagate
Description copied from interface:ConnectablePotentially propagate the the connectors current siganl- Specified by:
propagatein interfaceConnectableseen- is IDs of allConnectableitems which have already propagated
-
setActive
Description copied from interface:ConnectableSet theConnectableto beconnectedThis may or may not propagate the signal- Specified by:
setActivein interfaceConnectable
-
isConnected
public boolean isConnected()Description copied from interface:ConnectableGet whether or not this Connectable is connected (active)- Specified by:
isConnectedin interfaceConnectable
-
getDisplayName
- Specified by:
getDisplayNamein classItemProperty<PhantomProperty.PhantomPropertyValue>- Returns:
- name of this property, used as a display string in menus
-
getType
- Specified by:
getTypein classItemProperty<PhantomProperty.PhantomPropertyValue>- Returns:
PropertyTypeof this property. This allows us to get the property of an item from it's property map- See Also:
-
write
public void write(com.badlogic.gdx.utils.Json json) - Specified by:
writein interfacecom.badlogic.gdx.utils.Json.Serializable- Overrides:
writein classPhantomProperty
-
read
public void read(com.badlogic.gdx.utils.Json json, com.badlogic.gdx.utils.JsonValue jsonData) - Specified by:
readin interfacecom.badlogic.gdx.utils.Json.Serializable- Overrides:
readin classPhantomProperty
-
updateColor
protected void updateColor() -
acceptSignalFrom
public void acceptSignalFrom(Connectable source, Types.IntVector2 position, GameContext ctx, HashSet<Integer> seen) Description copied from interface:ConnectableCalled when thisConnectablereceives a signal from another.- Specified by:
acceptSignalFromin interfaceConnectable- Parameters:
source- the Connectable sending the signalposition- the source's positionseen- A set of already visited IDs
-
getCustomItemConfigurationMenu
Description copied from class:ItemPropertyGet aPropertyConfigurationthat contains all fields necessary to configure this property in theItemEditor- Overrides:
getCustomItemConfigurationMenuin classItemProperty<PhantomProperty.PhantomPropertyValue>- Returns:
- Some(
PropertyConfiguration) should this property need configuration
-