Class StructureID
There are three types of UIDs:
- Registered UIDs: Always
>= 1.These are UIDs that have been assigned to structures by the storage system.
These are assigned by the database system and should not be assigned manually. Consequently, these are only available after the structure has been stored in the database.
- Unassigned ID: Always
-1.This is used for structures that have not been assigned a UID yet.
You can get this value by calling
getUnassignedID(). - Unregistered UID: Always
<= -1000.Like the unassigned ID, this is used for structures that have not been assigned a UID yet. However, unlike the unassigned ID, an unregistered ID is guaranteed to be unique.
These can be used for temporary structures that are never stored in the database (e.g. to show a user an animation preview).
-
Method Summary
Modifier and TypeMethodDescriptionbooleanlonggetId()The ID that has been assigned to the structure.static StructureIDGets a StructureID used for structures that do not have an ID assigned yet.static StructureIDGets an unregistered ID.inthashCode()static StructureIDof(AssignedUIDSqlite assignedUIDSqlite) Creates an AssignedUID object from an AssignedUIDSqlite object.
-
Method Details
-
getUnassignedID
Gets a StructureID used for structures that do not have an ID assigned yet.- Returns:
- A StructureID with an ID of -1.
-
getUnregisteredID
Gets an unregistered ID.This is a unique ID that is not registered in the database.
- Returns:
- A unique unregistered StructureID.
-
of
Creates an AssignedUID object from an AssignedUIDSqlite object.- Parameters:
assignedUIDSqlite- The AssignedUIDSqlite object to create an AssignedUID object from.- Returns:
- The created AssignedUID object.
-
equals
-
hashCode
public int hashCode() -
getId
public long getId()The ID that has been assigned to the structure.
-