Class ValueTypeCategoryBase<V extends IValue>
java.lang.Object
org.cyclops.integrateddynamics.core.evaluate.variable.ValueTypeBase<V>
org.cyclops.integrateddynamics.core.evaluate.variable.ValueTypeCategoryBase<V>
- All Implemented Interfaces:
IValueType<V>,IValueTypeCategory<V>
- Direct Known Subclasses:
ValueTypeCategoryAny,ValueTypeCategoryNamed,ValueTypeCategoryNullable,ValueTypeCategoryNumber,ValueTypeCategoryUniquelyNamed
public abstract class ValueTypeCategoryBase<V extends IValue>
extends ValueTypeBase<V>
implements IValueTypeCategory<V>
Base implementation of a value type category.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.cyclops.integrateddynamics.api.evaluate.variable.IValueType
IValueType.ValueTypeComparator -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionValueTypeCategoryBase(String typeName, int color, net.minecraft.ChatFormatting colorFormat, Class<V> valueClass) Make a new instance.ValueTypeCategoryBase(String typeName, int color, net.minecraft.ChatFormatting colorFormat, Set<IValueType<?>> elements, Class<V> valueClass) Make a new instance. -
Method Summary
Modifier and TypeMethodDescriptionbooleancorrespondsTo(IValueType<?> valueType) Check if the given type corresponds with this type.deserialize(ValueDeseralizationContext valueDeseralizationContext, net.minecraft.nbt.Tag value) Deserialize the given value.Create an immutable default value.Set<IValueType<?>>protected StringgetModId()booleannet.minecraft.nbt.TagSerialize the given value.net.minecraft.network.chat.MutableComponenttoCompactString(V value) Methods inherited from class org.cyclops.integrateddynamics.core.evaluate.variable.ValueTypeBase
canDeserialize, cast, getDisplayColor, getDisplayColorFormat, getTypeName, getTypeNamespace, getUniqueName, getUnlocalizedPrefix, isObject, loadTooltip, materialize, parseString, registerModelResourceLocation, toString, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.cyclops.integrateddynamics.api.evaluate.variable.IValueType
canDeserialize, cast, deserializeValuePredicate, getDisplayColor, getDisplayColorFormat, getTypeName, getUniqueName, getVariableItemOverrideModel, isObject, loadTooltip, materialize, parseString, renderISTER, toString
-
Field Details
-
elements
-
-
Constructor Details
-
ValueTypeCategoryBase
public ValueTypeCategoryBase(String typeName, int color, net.minecraft.ChatFormatting colorFormat, Set<IValueType<?>> elements, Class<V> valueClass) Make a new instance.- Parameters:
typeName- The category name.color- The color.colorFormat- The color format.elements- The elements inside this category.valueClass- The value type class.
-
ValueTypeCategoryBase
public ValueTypeCategoryBase(String typeName, int color, net.minecraft.ChatFormatting colorFormat, Class<V> valueClass) Make a new instance.- Parameters:
typeName- The category name.color- The color.colorFormat- The color format.valueClass- The value type class.
-
-
Method Details
-
isCategory
public boolean isCategory()- Specified by:
isCategoryin interfaceIValueType<V extends IValue>- Overrides:
isCategoryin classValueTypeBase<V extends IValue>- Returns:
- If this type is a category and should be handled accordingly.
-
getDefault
Description copied from interface:IValueTypeCreate an immutable default value.- Specified by:
getDefaultin interfaceIValueType<V extends IValue>- Returns:
- The default value of this type.
-
getTranslationKey
- Specified by:
getTranslationKeyin interfaceIValueType<V extends IValue>- Overrides:
getTranslationKeyin classValueTypeBase<V extends IValue>- Returns:
- The unique name of this type that will also be used for display.
-
toCompactString
- Specified by:
toCompactStringin interfaceIValueType<V extends IValue>- Parameters:
value- The value- Returns:
- A short string representation used in guis to show the value.
-
correspondsTo
Description copied from interface:IValueTypeCheck if the given type corresponds with this type. To check bidirectional, useValueHelpers.correspondsTo(IValueType, IValueType).- Specified by:
correspondsToin interfaceIValueType<V extends IValue>- Overrides:
correspondsToin classValueTypeBase<V extends IValue>- Parameters:
valueType- The value type to check correspondence with.- Returns:
- If the given value type can be used with this value type.
-
serialize
Description copied from interface:IValueTypeSerialize the given value.- Specified by:
serializein interfaceIValueType<V extends IValue>- Parameters:
value- The value to serialize.- Returns:
- The serialized value.
-
deserialize
public V deserialize(ValueDeseralizationContext valueDeseralizationContext, net.minecraft.nbt.Tag value) Description copied from interface:IValueTypeDeserialize the given value.- Specified by:
deserializein interfaceIValueType<V extends IValue>- Parameters:
valueDeseralizationContext- Deserialization context.value- The value to deserialize.- Returns:
- The deserialized value.
-
getModId
- Overrides:
getModIdin classValueTypeBase<V extends IValue>
-
getElements
- Specified by:
getElementsin interfaceIValueTypeCategory<V extends IValue>- Returns:
- The value types that are part of this category.
-
createLogicProgrammerElement
- Specified by:
createLogicProgrammerElementin interfaceIValueType<V extends IValue>- Overrides:
createLogicProgrammerElementin classValueTypeBase<V extends IValue>- Returns:
- A new logic programmer element for this value type.
-