Class StructureModifier
java.lang.Object
nl.pim16aap2.animatedarchitecture.core.structures.StructureModifier
Class that can modify some protected aspects of structures.
-
Method Summary
Modifier and TypeMethodDescriptionbooleanaddOwner(Structure structure, StructureOwner structureOwner) Adds an owner to a structure.static StructureModifierget(DatabaseManager.FriendKey friendKey) Obtains the instance of this class.@Nullable StructureOwnerremoveOwner(Structure structure, UUID ownerUUID) Removes an owner from this structure.
-
Method Details
-
get
Obtains the instance of this class.Note that only the
DatabaseManageris 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
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
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.
-