Package org.empirewar.orbis.world
Interface RegionisedWorld
- All Superinterfaces:
RegionQuery.Position.Queryable
- All Known Implementing Classes:
RegionisedWorldSet
public sealed interface RegionisedWorld
extends RegionQuery.Position.Queryable
permits RegionisedWorldSet
Represents a world that contains a set of
Regions.
Several methods are provided through applicable RegionQuery
subclasses to allow specific queries for regions.
-
Method Summary
Modifier and TypeMethodDescriptionbooleanAttempts to add a region to this world.Gets a region by the specified name, if it is present.regions()Gets the set of regions within this regionised world.booleanAttempts to remove a region from this world.Optional<net.kyori.adventure.key.Key> worldId()Gets the key of the world this represents.Methods inherited from interface org.empirewar.orbis.query.RegionQuery.Position.Queryable
query, query
-
Method Details
-
worldId
Optional<net.kyori.adventure.key.Key> worldId()Gets the key of the world this represents.This method may return an empty optional if this is a "global holder" of all regions.
- Returns:
- key of world this represents
-
regions
Gets the set of regions within this regionised world.- Returns:
- all regions within this world
-
getByName
Gets a region by the specified name, if it is present.- Parameters:
regionName- the region name- Returns:
- an optional with the region if present, else
Optional.empty()
-
add
Attempts to add a region to this world.- Parameters:
region- the region to add- Returns:
- false if the region is already attached to this world
-
remove
Attempts to remove a region from this world.- Parameters:
region- the region to remove- Returns:
- true if the region was present and was successfully removed
-