Package me.deecaad.core.mechanics
Class MechanicManager
java.lang.Object
me.deecaad.core.mechanics.MechanicManager
- All Implemented Interfaces:
Serializer<MechanicManager>
-
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor for serializer.MechanicManager(List<Mechanic> mechanics) -
Method Summary
Modifier and TypeMethodDescriptionvoidWeaponMechanicsPlus modifies this to temporarily append mechanics.voidWhen usingaddDirty(List), after casting the mechanics (use(CastData)), you should clear the dirty mechanics.Returns the unique identifier to this serializer.@Nullable StringReturns a link to the page on the wiki that describes this serializer.booleanisDirty()@NotNull MechanicManagerserialize(@NotNull me.deecaad.core.file.SerializeData data) Instantiates a new Object to be added into the finalized configuration.serializeOne(me.deecaad.core.file.SerializeData data, String line) voidMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface me.deecaad.core.file.Serializer
canUsePathTo, getName, getParentKeywords, letPassThrough, shouldSerialize, tryPathTo, useLater
-
Constructor Details
-
MechanicManager
public MechanicManager()Default constructor for serializer. -
MechanicManager
-
-
Method Details
-
getMechanics
-
addDirty
WeaponMechanicsPlus modifies this to temporarily append mechanics.- Parameters:
mechanics- The list of mechanics to temporarily add.
-
isDirty
public boolean isDirty()- Returns:
- true if there are temporary mechanics.
-
clearDirty
public void clearDirty()When usingaddDirty(List), after casting the mechanics (use(CastData)), you should clear the dirty mechanics.This method is automatically called after using
use(CastData). -
getKeyword
Description copied from interface:SerializerReturns the unique identifier to this serializer. This identifier is used to determine when to apply the serializer to a config section. The identifier is case-sensitive, and it is ignored whennull.Generally speaking, you should always override this method. When you do not need automatic serializer handling, you may return null.
- Specified by:
getKeywordin interfaceSerializer<MechanicManager>- Returns:
- The nullable unique identifier.
-
getWikiLink
Description copied from interface:SerializerReturns a link to the page on the wiki that describes this serializer. This method is called fromSerializeData, and is used to help the user find potential solutions to their problem.- Specified by:
getWikiLinkin interfaceSerializer<MechanicManager>- Returns:
- The nullable link to the wiki.
-
use
-
serialize
@NotNull public @NotNull MechanicManager serialize(@NotNull @NotNull me.deecaad.core.file.SerializeData data) throws me.deecaad.core.file.SerializerException Description copied from interface:SerializerInstantiates a new Object to be added into the finalized configuration. The object should be built off ofSerializeData.getConfig(). If there is any misconfiguration (or any other issue preventing the construction of an object), then this method should throw aSerializerException. This method may not return null.- Specified by:
serializein interfaceSerializer<MechanicManager>- Parameters:
data- The non-null data containing config- Returns:
- The non-null serialized data.
- Throws:
me.deecaad.core.file.SerializerException- If there is an error in config.
-
serializeOne
public Mechanic serializeOne(me.deecaad.core.file.SerializeData data, String line) throws me.deecaad.core.file.SerializerException - Throws:
me.deecaad.core.file.SerializerException
-