Package org.empirewar.orbis.world
Class RegionisedWorldSet
java.lang.Object
org.empirewar.orbis.world.RegionisedWorldSet
- All Implemented Interfaces:
RegionQuery.Position.Queryable,RegionisedWorld
Holds the regions of a world. Uses a 3D RTree to query regions.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanAttempts to add a region to this world.Gets a region by the specified name, if it is present.query(RegionQuery.Position position) Queries for a set of regions for a specificRegionQuery.Positionquery.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 class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.empirewar.orbis.query.RegionQuery.Position.Queryable
query
-
Constructor Details
-
RegionisedWorldSet
public RegionisedWorldSet() -
RegionisedWorldSet
public RegionisedWorldSet(@Nullable @Nullable net.kyori.adventure.key.Key worldId)
-
-
Method Details
-
worldId
Description copied from interface:RegionisedWorldGets the key of the world this represents.This method may return an empty optional if this is a "global holder" of all regions.
- Specified by:
worldIdin interfaceRegionisedWorld- Returns:
- key of world this represents
-
query
public RegionQuery.FilterableRegionResult<RegionQuery.Position> query(RegionQuery.Position position) Description copied from interface:RegionQuery.Position.QueryableQueries for a set of regions for a specificRegionQuery.Positionquery.The returned
Set<Region>result is ordered with the region of the highest priority first.- Specified by:
queryin interfaceRegionQuery.Position.Queryable- Parameters:
position- the position query- Returns:
- the query
RegionQuery.Result - See Also:
-
regions
Description copied from interface:RegionisedWorldGets the set of regions within this regionised world.- Specified by:
regionsin interfaceRegionisedWorld- Returns:
- all regions within this world
-
getByName
Description copied from interface:RegionisedWorldGets a region by the specified name, if it is present.- Specified by:
getByNamein interfaceRegionisedWorld- Parameters:
regionName- the region name- Returns:
- an optional with the region if present, else
Optional.empty()
-
add
Description copied from interface:RegionisedWorldAttempts to add a region to this world.- Specified by:
addin interfaceRegionisedWorld- Parameters:
region- the region to add- Returns:
- false if the region is already attached to this world
-
remove
Description copied from interface:RegionisedWorldAttempts to remove a region from this world.- Specified by:
removein interfaceRegionisedWorld- Parameters:
region- the region to remove- Returns:
- true if the region was present and was successfully removed
-