public interface Arena extends MetadataHolder, ComponentOwner, Component<Minigame>, Buildable<Arena.Builder>
Modifier and Type | Interface and Description |
---|---|
static interface |
Arena.Builder
A builder for
Arena objects. |
Modifier and Type | Method and Description |
---|---|
int |
addSpawnPoint(Location3D spawn)
Adds the given
Location3D to this Arena 's possible
spawn points. |
Optional<ChallengerListingLobbySign> |
createChallengerListingLobbySign(Location3D location,
int index)
Attempts to register a
ChallengerListingLobbySign at the given
location . |
Round |
createRound()
|
Round |
createRound(ImmutableSet<LifecycleStage> stages)
|
Optional<StatusLobbySign> |
createStatusLobbySign(Location3D location)
Attempts to register a
StatusLobbySign at the given
location . |
Boundary |
getBoundary()
|
String |
getDisplayName()
Gets the display name of this
Arena as seen by users. |
String |
getId()
Gets the identifier of this
Arena . |
Optional<LobbySign> |
getLobbySignAt(Location3D location)
Gets the
LobbySign at the given Location3D , if present. |
ImmutableList<LobbySign> |
getLobbySigns()
|
Minigame |
getMinigame()
|
String |
getName()
Deprecated.
Ambiguous naming - use
getDisplayName() |
Round |
getOrCreateRound()
Attempts to get the
Round contained by this arena, or if not
present, creates and returns a new one with the default lifecycle stages. |
Round |
getOrCreateRound(ImmutableSet<LifecycleStage> stages)
Attempts to get the
Round contained by this arena, or if not
present, creates and returns a new one with the given lifecycle stages. |
Optional<Round> |
getRound()
|
ImmutableMap<Integer,Location3D> |
getSpawnPoints()
Returns an
ImmutableMap of points at which players may spawn
upon entering this arena, mapped to their respective IDs. |
String |
getWorld()
Gets the name of the world which contains this
Arena . |
void |
markForRollback(Location3D location)
Explicitly marks a location for rollback.
|
void |
removeSpawnPoint(int index)
Removes the spawn point of the given index from this
Arena . |
void |
removeSpawnPoint(Location3D location)
Removes the spawn point(s) at the given location from this
Arena . |
void |
rollback()
|
void |
setBoundary(Boundary bound)
|
void |
setDisplayName(String displayName)
Sets the display name of this
Arena as seen by users. |
getMetadata
Minigame getMinigame() throws OrphanedComponentException
Minigame
this Arena
is owned byOrphanedComponentException
- If this object is orphaned (see
Component
for details)String getId() throws OrphanedComponentException
Arena
.Arena
OrphanedComponentException
- If this object is orphaned (see
Component
for details)@Deprecated String getName() throws OrphanedComponentException
getDisplayName()
Arena
as seen by users.Arena
as seen by users,
or its ID if one is not setOrphanedComponentException
- If this object is orphaned (see
Component
for details)String getDisplayName() throws OrphanedComponentException
Arena
as seen by users.Arena
as seen by users,
or its ID if one is not setOrphanedComponentException
- If this object is orphaned (see
Component
for details)void setDisplayName(String displayName)
Arena
as seen by users.displayName
- The new display name of this Arena
as seen by
usersOrphanedComponentException
- If this object is orphaned (see
Component
for details)String getWorld() throws OrphanedComponentException
Arena
.Arena
OrphanedComponentException
- If this object is orphaned (see
Component
for details)Boundary getBoundary() throws OrphanedComponentException
Boundary
which this Arena
is containedOrphanedComponentException
- If this object is orphaned (see
Component
for details)
withinvoid setBoundary(Boundary bound) throws OrphanedComponentException
bound
- The new Boundary
which this Arena
is to be
contained withinOrphanedComponentException
- If this object is orphaned (see
Component
for details)ImmutableMap<Integer,Location3D> getSpawnPoints() throws OrphanedComponentException
ImmutableMap
of points at which players may spawn
upon entering this arena, mapped to their respective IDs.BiMap
of points at which players may spawn
upon entering this arena, mapped to their respective IDsOrphanedComponentException
- If this object is orphaned (see
Component
for details)int addSpawnPoint(Location3D spawn) throws IllegalArgumentException, OrphanedComponentException
Location3D
to this Arena
's possible
spawn points.spawn
- The Location3D
to add as a new spawn pointIllegalArgumentException
- If the spawn point is not contained by
the Arena
's Boundary
, or if its world differs from
the Arena
'sOrphanedComponentException
- If this object is orphaned (see
Component
for details)void removeSpawnPoint(int index) throws OrphanedComponentException
Arena
.index
- The index of the spawn point to removeIllegalArgumentException
- If a spawn point at the given index does
not existOrphanedComponentException
- If this object is orphaned (see
Component
for details)void removeSpawnPoint(Location3D location) throws OrphanedComponentException
Arena
.location
- The location of the spawn point(s) to removeIllegalArgumentException
- If no spawn points are defined at the
given locationOrphanedComponentException
- If this object is orphaned (see
Component
for details)Optional<Round> getRound() throws OrphanedComponentException
Round
contained by this Arena
OrphanedComponentException
- If this object is orphaned (see
Component
for details)Round createRound(ImmutableSet<LifecycleStage> stages) throws IllegalArgumentException, IllegalStateException, OrphanedComponentException
stages
- A LinkedHashSet
containing LifecycleStage
s
to define for the new Round
Round
IllegalArgumentException
- If stages
is null
or
contains an empty setIllegalStateException
- If a Round
already exists in this
Arena
OrphanedComponentException
- If this object is orphaned (see
Component
for details)Round createRound() throws IllegalStateException, OrphanedComponentException
Round
IllegalStateException
- If a Round
already exists in this
Arena
, or if the default LifecycleStage
s have not
been set as a config optionOrphanedComponentException
- If this object is orphaned (see
Component
for details)Round getOrCreateRound(ImmutableSet<LifecycleStage> stages) throws IllegalArgumentException, OrphanedComponentException
Round
contained by this arena, or if not
present, creates and returns a new one with the given lifecycle stages.stages
- A LinkedHashSet
containing LifecycleStage
s
to define for the new Round
Round
IllegalArgumentException
- If stages
is null
or
contains an empty setOrphanedComponentException
- If this object is orphaned (see
Component
for details)Round getOrCreateRound() throws OrphanedComponentException
Round
contained by this arena, or if not
present, creates and returns a new one with the default lifecycle stages.Round
OrphanedComponentException
- If this object is orphaned (see
Component
for details)ImmutableList<LobbySign> getLobbySigns() throws OrphanedComponentException
ImmutableList
of LobbySign
s registered for
this Arena
OrphanedComponentException
- If this object is orphaned (see
Component
for details)Optional<LobbySign> getLobbySignAt(Location3D location) throws IllegalArgumentException, OrphanedComponentException
LobbySign
at the given Location3D
, if present.location
- The location
at which to search for a
LobbySign
LobbySign
at the given Location3D
, or
Optional.absent()
if none is registeredIllegalArgumentException
- If location
does not define a worldOrphanedComponentException
- If this object is orphaned (see
Component
for details)Optional<StatusLobbySign> createStatusLobbySign(Location3D location) throws IllegalArgumentException, OrphanedComponentException
StatusLobbySign
at the given
location
.location
- The location
to register the sign atStatusLobbySign
, or
Optional.absent()
if the passed location does not contain a
sign type or already contains a registered LobbySign
IllegalArgumentException
- If location
does not define a worldOrphanedComponentException
- If this object is orphaned (see
Component
for details)Optional<ChallengerListingLobbySign> createChallengerListingLobbySign(Location3D location, int index) throws IllegalArgumentException, OrphanedComponentException
ChallengerListingLobbySign
at the given
location
.location
- The location
to register the sign atindex
- The index of the sign (see
ChallengerListingLobbySign.getIndex()
for more infoStatusLobbySign
, or
Optional.absent()
if the passed location does not contain a
sign type or already contains a registered LobbySign
IllegalArgumentException
- If location
does not define a worldOrphanedComponentException
- If this object is orphaned (see
Component
for details)void markForRollback(Location3D location) throws IllegalArgumentException, RollbackException, OrphanedComponentException
Note: This will have no effect if a rollback record already exists at the location.
location
- The Location3D
to mark for rollbackIllegalArgumentException
- If the provided location is not
contained by this Arena
's Boundary
RollbackException
- If an exception occurs while marking the
location for rollbackOrphanedComponentException
- If this object is orphaned (see
Component
for details)void rollback() throws IllegalStateException, OrphanedComponentException
IllegalStateException
- If no Round
has taken place in this
Arena
since the last call to this method upon itOrphanedComponentException
- If this object is orphaned (see
Component
for details)