Class Toggleable
java.lang.Object
group24.escaperoom.entities.properties.ItemProperty<PhantomProperty.PhantomPropertyValue>
group24.escaperoom.entities.properties.PhantomProperty
group24.escaperoom.entities.properties.Toggleable
- All Implemented Interfaces:
com.badlogic.gdx.utils.Json.Serializable
An item implementing Toggleable should have a texture
-
Nested Class Summary
Nested classes/interfaces inherited from class group24.escaperoom.entities.properties.PhantomProperty
PhantomProperty.PhantomPropertyValueNested classes/interfaces inherited from class group24.escaperoom.entities.properties.ItemProperty
ItemProperty.MenuType -
Field Summary
Fields inherited from class group24.escaperoom.entities.properties.ItemProperty
owner -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddefaultConfiguration(Item owner) com.badlogic.gdx.utils.Array<PlayerAction>getType()booleanvoidread(com.badlogic.gdx.utils.Json json, com.badlogic.gdx.utils.JsonValue jsonData) voidUpdates the owner's texture based on the property.voidwrite(com.badlogic.gdx.utils.Json json) Methods inherited from class group24.escaperoom.entities.properties.PhantomProperty
getInputType, getPotentialValues, getValueClassMethods inherited from class group24.escaperoom.entities.properties.ItemProperty
apply, cloneProperty, getActions, getCurrentValue, getCurrentValues, getCustomItemConfigurationMenu, getOwner, getPopOut, set, set, setOwner, unsafeSet, unsafeSet
-
Constructor Details
-
Toggleable
public Toggleable()
-
-
Method Details
-
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:
-
isToggled
public boolean isToggled() -
getAvailableActions
- Overrides:
getAvailableActionsin classPhantomProperty- Returns:
- all available
PlayerAction
-
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
-
updateTexture
public void updateTexture()Description copied from class:ItemPropertyUpdates the owner's texture based on the property. Properties which do not change the texture should not override this function. Typically used when reloading textures on already placed items.- Overrides:
updateTexturein classItemProperty<PhantomProperty.PhantomPropertyValue>
-
defaultConfiguration
- Overrides:
defaultConfigurationin classItemProperty<PhantomProperty.PhantomPropertyValue>- Parameters:
owner- create a default configuration of this property for the given owner
-
getDescription
- Specified by:
getDescriptionin classItemProperty<PhantomProperty.PhantomPropertyValue>- Returns:
- the
PropertyDescriptionof this Property
-