public interface RegionSelector
Regions from a series of "selected points."
They are used, for example, to allow users to create a CuboidRegion
by selecting two corners of the cuboid.| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Clear the selection.
|
void |
explainPrimarySelection(Actor actor,
LocalSession session,
Vector position)
Tell the player information about his/her primary selection.
|
void |
explainRegionAdjust(Actor actor,
LocalSession session)
The the player information about the region's changes.
|
void |
explainSecondarySelection(Actor actor,
LocalSession session,
Vector position)
Tell the player information about his/her secondary selection.
|
int |
getArea()
Get the number of blocks inside the region.
|
Region |
getIncompleteRegion()
Get the region even if it's not fully defined.
|
List<String> |
getInformationLines()
Get lines of information about the selection.
|
BlockVector |
getPrimaryPosition()
Get the primary position.
|
Region |
getRegion()
Get the selection.
|
String |
getTypeName()
Get a lowercase name of this region selector type.
|
World |
getWorld()
Get the world for the region selector.
|
boolean |
isDefined()
Returns whether the region has been fully defined.
|
void |
learnChanges()
Update the selector with changes to the region.
|
boolean |
selectPrimary(Vector position,
SelectorLimits limits)
Called when the first point is selected.
|
boolean |
selectSecondary(Vector position,
SelectorLimits limits)
Called when the second point is selected.
|
void |
setWorld(World world)
Set the world for the region selector.
|
@Nullable World getWorld()
void setWorld(@Nullable World world)
world - the world, which may be nullboolean selectPrimary(Vector position, SelectorLimits limits)
position - the positionboolean selectSecondary(Vector position, SelectorLimits limits)
position - the positionvoid explainPrimarySelection(Actor actor, LocalSession session, Vector position)
actor - the actorsession - the sessionposition - positionvoid explainSecondarySelection(Actor actor, LocalSession session, Vector position)
actor - the actorsession - the sessionposition - positionvoid explainRegionAdjust(Actor actor, LocalSession session)
actor - the actorsession - the sessionBlockVector getPrimaryPosition() throws IncompleteRegionException
IncompleteRegionException - thrown if a region has not been fully definedRegion getRegion() throws IncompleteRegionException
IncompleteRegionException - thrown if a region has not been fully definedRegion getIncompleteRegion()
boolean isDefined()
int getArea()
void learnChanges()
void clear()
String getTypeName()
Copyright © 2010-2014. All Rights Reserved.