Class SpinnableProperty
java.lang.Object
group24.escaperoom.entities.properties.ItemProperty<PhantomProperty.PhantomPropertyValue>
group24.escaperoom.entities.properties.PhantomProperty
group24.escaperoom.entities.properties.SpinnableProperty
- All Implemented Interfaces:
com.badlogic.gdx.utils.Json.Serializable
-
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
FieldsFields inherited from class group24.escaperoom.entities.properties.ItemProperty
owner -
Constructor Summary
ConstructorsConstructorDescriptionEmpty constructor forJson.SerializablecompatabilitySpinnableProperty(Item owner, int pixelWidth, int pixelHeight, int spinCount) -
Method Summary
Modifier and TypeMethodDescriptioncloneProperty(Item newOwner) static intdegreesToSpinCount(float degrees) Get aPropertyConfigurationthat contains all fields necessary to configure this property in theItemEditorintgetType()voidread(com.badlogic.gdx.utils.Json json, com.badlogic.gdx.utils.JsonValue jsonData) voidsetSpin(int spinCount) voidvoidUpdates the owner's texture based on the property.voidwrite(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, defaultConfiguration, getActions, getCurrentValue, getCurrentValues, getOwner, getPopOut, set, set, setOwner, unsafeSet, unsafeSet
-
Field Details
-
PIXELS_PER_WORLD_UNIT
public static final int PIXELS_PER_WORLD_UNIT- See Also:
-
-
Constructor Details
-
SpinnableProperty
public SpinnableProperty()Empty constructor forJson.Serializablecompatability -
SpinnableProperty
-
-
Method Details
-
getDescription
- Specified by:
getDescriptionin classItemProperty<PhantomProperty.PhantomPropertyValue>- Returns:
- the
PropertyDescriptionof this Property
-
updateSize
public void updateSize() -
setSpin
public void setSpin(int spinCount) -
getSpinCount
public int getSpinCount() -
degreesToSpinCount
public static int degreesToSpinCount(float degrees) -
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:
-
cloneProperty
- Overrides:
clonePropertyin classItemProperty<PhantomProperty.PhantomPropertyValue>- Parameters:
newOwner- the new owner of this property- Returns:
- a clone of this item property (along with state and values) for a new item
-
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>
-
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
-
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
-