Class MechanicManager

java.lang.Object
me.deecaad.core.mechanics.MechanicManager
All Implemented Interfaces:
Serializer<MechanicManager>

public class MechanicManager extends Object implements Serializer<MechanicManager>
  • Constructor Details

    • MechanicManager

      public MechanicManager()
      Default constructor for serializer.
    • MechanicManager

      public MechanicManager(List<Mechanic> mechanics)
  • Method Details

    • getMechanics

      public List<Mechanic> getMechanics()
    • addDirty

      public void addDirty(List<Mechanic> mechanics)
      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 using addDirty(List), after casting the mechanics (use(CastData)), you should clear the dirty mechanics.

      This method is automatically called after using use(CastData).

    • getKeyword

      public String getKeyword()
      Description copied from interface: Serializer
      Returns 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 when null.

      Generally speaking, you should always override this method. When you do not need automatic serializer handling, you may return null.

      Specified by:
      getKeyword in interface Serializer<MechanicManager>
      Returns:
      The nullable unique identifier.
    • getWikiLink

      @Nullable public @Nullable String getWikiLink()
      Description copied from interface: Serializer
      Returns a link to the page on the wiki that describes this serializer. This method is called from SerializeData, and is used to help the user find potential solutions to their problem.
      Specified by:
      getWikiLink in interface Serializer<MechanicManager>
      Returns:
      The nullable link to the wiki.
    • use

      public void use(CastData cast)
    • serialize

      @NotNull public @NotNull MechanicManager serialize(@NotNull @NotNull me.deecaad.core.file.SerializeData data) throws me.deecaad.core.file.SerializerException
      Description copied from interface: Serializer
      Instantiates a new Object to be added into the finalized configuration. The object should be built off of SerializeData.getConfig(). If there is any misconfiguration (or any other issue preventing the construction of an object), then this method should throw a SerializerException. This method may not return null.
      Specified by:
      serialize in interface Serializer<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