Class StructureModifier

java.lang.Object
nl.pim16aap2.animatedarchitecture.core.structures.StructureModifier

public final class StructureModifier extends Object
Class that can modify some protected aspects of structures.
  • Method Details

    • get

      public static StructureModifier get(DatabaseManager.FriendKey friendKey)
      Obtains the instance of this class.

      Note that only the DatabaseManager is allowed to get an instance at this time. This is for good reason, as using this object through other means can leave the structure in an incorrect state. So, if you think you need to access this class, please think again and again until you realise that you do not.

      Instead, use the publicly accessible methods in the database manager and the structure class.

      Parameters:
      friendKey - The friend key of the database manager class. This is used to verify that the caller is allowed to obtain access to this class.
      Returns:
      The instance of this class.
    • addOwner

      public boolean addOwner(Structure structure, StructureOwner structureOwner)
      Adds an owner to a structure.
      Parameters:
      structure - The structure to add the owner to.
      structureOwner - The new owner of the door.
      Returns:
      True if the owner was removed.
    • removeOwner

      public @Nullable StructureOwner removeOwner(Structure structure, UUID ownerUUID)
      Removes an owner from this structure.
      Parameters:
      structure - The structure to remove the owner from.
      ownerUUID - The UUID of the owner to remove.
      Returns:
      The owner that was removed. If no owner with that UUID exists, or if that specific owner could not be removed, the result will be null.