Class CarriedItem<T extends PieceOfGear>
java.lang.Object
de.rpgframework.genericrpg.modification.ModifyableImpl
de.rpgframework.genericrpg.data.DataItemValue<T>
de.rpgframework.genericrpg.data.ComplexDataItemValue<T>
de.rpgframework.genericrpg.items.CarriedItem<T>
- All Implemented Interfaces:
DecisionContainer,IReferenceResolver,ResolvableDataItem<T>,Modifyable,NumericalValue<T>,SelectedValue<T>
@Root(name="item")
public class CarriedItem<T extends PieceOfGear>
extends ComplexDataItemValue<T>
implements IReferenceResolver
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Stringprotected List<CarriedItem<?>> protected List<ItemEnhancementValue> protected booleanItem needs recalculationprotected booleanprotected int[]protected CarriedItem<T> protected List<Requirement> protected Map<Hook, AAvailableSlot<? extends Hook, T>> protected LifeformFields inherited from class de.rpgframework.genericrpg.data.ComplexDataItemValue
autoFlags, decisions, flags, uuidFields inherited from class de.rpgframework.genericrpg.data.DataItemValue
character, customName, injectedBy, language, ref, resolved, valueFields inherited from class de.rpgframework.genericrpg.modification.ModifyableImpl
incomingModifications, outgoingModifications -
Constructor Summary
ConstructorsConstructorDescriptionCarriedItem(CarriedItem<T> toCopy) CarriedItem(T item, PieceOfGearVariant<?> variant, CarryMode mode) Use the item in NORMAL usage -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAccessory(CarriedItem<T> val, Hook slot) voidaddAlternates(CarriedItem<?> alt) voidvoidvoidvoidvoidaddSlot(AAvailableSlot slot) voidvoidstatic Map<IItemAttribute, ItemAttributeValue<IItemAttribute>> dump()List<CarriedItem<T>> List<CarriedItem<T>> getAccessory(String id, String variant) getActiveOperationModes(boolean recursive) List<CarriedItem<?>> <A extends IItemAttribute>
ItemAttributeFloatValue<A> getAsFloat(A attrib) <A extends IItemAttribute>
ItemAttributeObjectValue<A> getAsObject(A attrib) <A extends IItemAttribute>
ItemAttributeNumericalValue<A> getAsValue(A attrib) intgetCount()<E extends AItemEnhancement>
ItemEnhancementValue<E> getEnhancement(E data) <E extends AItemEnhancement>
List<ItemEnhancementValue<E>> byte[]getImage()int[]intgetNameWithCount(Locale loc) getNameWithRating(Locale loc) getNotes()getOperationModes(boolean recursive) <A extends AAvailableSlot<? extends Hook, T>>
ACollection<AAvailableSlot<? extends Hook, T>> getSlots()getUser()getUuid()booleanbooleanhasEnhancement(AItemEnhancement value) booleanisDirty()<A extends IItemAttribute>
booleanisFloat(A attrib) booleanremoveAccessory(CarriedItem<T> val, Hook slot) voidvoidremoveSlot(Hook hook) voidreset()Remove all incoming and outgoing modifications<T> TresolveItem(String key) voidsetAllowedHooks(Collection<Usage> value) voidsetAttribute(IItemAttribute attrib, ItemAttributeValue val) voidsetCarryMode(CarryMode mode) voidsetCount(int count) voidsetDecisions(List<Decision> val) voidsetDirty(boolean dirty) voidsetImage(byte[] image) voidsetLastRecalculateResult(OperationResult<List<Modification>> unprocessed) voidsetMode(OperationMode mode, boolean active) voidsetModificationSlotChanges(int[] modificationSlotChanges) voidvoidsetParent(CarriedItem<T> parent) voidsetResolved(T template, PieceOfGearVariant variant) voidsetUsedSlot(Hook slot) voidvoidsetVariant(PieceOfGearVariant variant) toString()Methods inherited from class de.rpgframework.genericrpg.data.ComplexDataItemValue
addAutoFlag, addAutoFlag, addDecision, addFlag, clearAutoFlags, clearEmptyFlags, getAutoFlags, getChoiceMapRecursivly, getDecision, getDecisionArray, getDecisionByRef, getDecisionByType, getDecisions, getDecisionString, getDecisionString, getFlags, getPerDecisionString, getPool, hasAutoFlag, hasFlag, hasFlag, hasUserFlag, removeAutoFlag, removeDecision, removeDecision, removeFlag, setAutoFlag, setAutoFlag, setFlag, setPool, setUuid, updateDecision, updateOutgoingModificiationsMethods inherited from class de.rpgframework.genericrpg.data.DataItemValue
getCharacter, getCustomName, getDistributed, getInjectedBy, getKey, getLanguage, getModifyable, getNameWithoutDecisions, getNameWithRating, getResolved, getShortName, isAutoAdded, setCharacter, setCustomName, setDistributed, setInjectedBy, setLanguage, setResolvedMethods inherited from class de.rpgframework.genericrpg.modification.ModifyableImpl
addIncomingModification, addModifications, addOutgoingModification, clearIncomingModifications, clearOutgoingModifications, getIncomingModifications, getOutgoingModifications, removeIncomingModification, removeIncomingModificationForSource, removeIncomingModifications, setIncomingModificationsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface de.rpgframework.genericrpg.NumericalValue
getDistributed, setDistributedMethods inherited from interface de.rpgframework.genericrpg.SelectedValue
getModifyable
-
Field Details
-
activeMode
-
modificationSlotChanges
@Attribute(name="changes") @AttribConvert(IntegerArrayConverter.class) protected int[] modificationSlotChanges -
requirements
-
user
-
isInitialized
protected transient boolean isInitialized -
slots
-
autoEnhancements
-
alternates
-
dirty
protected transient boolean dirtyItem needs recalculation -
parent
-
-
Constructor Details
-
CarriedItem
public CarriedItem() -
CarriedItem
-
CarriedItem
Use the item in NORMAL usage
-
-
Method Details
-
deepCopy
public static Map<IItemAttribute, ItemAttributeValue<IItemAttribute>> deepCopy(Map<IItemAttribute, ItemAttributeValue<IItemAttribute>> old) -
toString
-
getNameWithoutRating
- Overrides:
getNameWithoutRatingin classComplexDataItemValue<T extends PieceOfGear>
-
getNameWithoutRating
- Overrides:
getNameWithoutRatingin classComplexDataItemValue<T extends PieceOfGear>
-
getNameWithRating
- Overrides:
getNameWithRatingin classComplexDataItemValue<T extends PieceOfGear>- See Also:
-
getNameWithCount
-
getTemplateID
-
setResolved
-
getAttributes
-
getAttributeKeys
-
getAsValue
-
isFloat
-
getAsFloat
-
getAsObject
-
setDecisions
-
getUuid
- Overrides:
getUuidin classComplexDataItemValue<T extends PieceOfGear>- Returns:
- the uuid
-
setAttribute
-
getAttributeRaw
-
dump
-
getVariantID
- Returns:
- the variantRef
-
getVariant
- Returns:
- the variant
-
setVariant
- Parameters:
variant- the variant to set
-
addRequirement
-
getRequirements
-
getCount
public int getCount()- Returns:
- the count
-
setCount
public void setCount(int count) - Parameters:
count- the count to set
-
getUser
- Returns:
- the user
-
setUser
- Parameters:
user- the user to set
-
addAccessory
-
removeAccessory
-
getAccessories
-
getAccessory
-
getEffectiveAccessories
-
reset
public void reset()Description copied from class:ComplexDataItemValueRemove all incoming and outgoing modifications- Overrides:
resetin classComplexDataItemValue<T extends PieceOfGear>- See Also:
-
getSlot
-
getSlots
-
addSlot
-
removeSlot
-
getUsedSlot
- Returns:
- the slot
-
setUsedSlot
- Parameters:
slot- the slot to set
-
getCarryMode
- Returns:
- the mode
-
setCarryMode
- Parameters:
mode- the mode to set
-
getNotes
- Returns:
- the notes
-
setNotes
- Parameters:
notes- the notes to set
-
getImage
public byte[] getImage() -
setImage
public void setImage(byte[] image) -
hasAttribute
-
isDirty
public boolean isDirty()- Returns:
- the dirty
-
setDirty
public void setDirty(boolean dirty) - Parameters:
dirty- the dirty to set
-
getEmbeddedItem
-
getOperationModes
-
getActiveOperationModes
-
setMode
-
addAutoEnhancement
-
getEnhancements
-
getEnhancement
-
hasEnhancement
-
addEnhancement
-
removeEnhancement
-
getModificationSlotsUsed
public int getModificationSlotsUsed() -
getAlternates
-
addAlternates
-
clearAlternates
public void clearAlternates() -
resolveItem
- Specified by:
resolveItemin interfaceIReferenceResolver- See Also:
-
getParent
-
setParent
-
getModificationSlotChanges
public int[] getModificationSlotChanges()- Returns:
- the modificationSlotChanges
-
setModificationSlotChanges
public void setModificationSlotChanges(int[] modificationSlotChanges) - Parameters:
modificationSlotChanges- the modificationSlotChanges to set
-
setLastRecalculateResult
-
getLastRecalculateResult
-
clearModificationsFromCharacter
public void clearModificationsFromCharacter() -
addModificationFromCharacter
-
getAllowedHooks
-
setAllowedHooks
-