public class Polygonal2DRegionSelector extends Object implements RegionSelector, CUIRegion
| Constructor and Description |
|---|
Polygonal2DRegionSelector(LocalWorld world)
Deprecated.
|
Polygonal2DRegionSelector(LocalWorld world,
int maxPoints) |
Polygonal2DRegionSelector(LocalWorld world,
List<BlockVector2D> points,
int minY,
int maxY) |
Polygonal2DRegionSelector(RegionSelector oldSelector)
Deprecated.
|
Polygonal2DRegionSelector(RegionSelector oldSelector,
int maxPoints) |
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Clear the selection.
|
void |
describeCUI(LocalSession session,
LocalPlayer player)
Sends CUI events describing the region for
versions of CUI equal to or greater than the
value supplied by getProtocolVersion().
|
void |
describeLegacyCUI(LocalSession session,
LocalPlayer player)
Sends CUI events describing the region for
versions of CUI smaller than the value
supplied by getProtocolVersion().
|
void |
explainPrimarySelection(LocalPlayer player,
LocalSession session,
Vector pos)
Tell the player information about his/her primary selection.
|
void |
explainRegionAdjust(LocalPlayer player,
LocalSession session)
The the player information about the region's changes.
|
void |
explainSecondarySelection(LocalPlayer player,
LocalSession session,
Vector pos)
Tell the player information about his/her secondary selection.
|
int |
getArea()
Get the number of blocks inside the region.
|
Polygonal2DRegion |
getIncompleteRegion()
Get the region even if it's not fully defined.
|
List<String> |
getInformationLines()
Get lines of information about the selection.
|
String |
getLegacyTypeID()
Returns the type ID to send to CUI in the selection
event if the CUI is in legacy mode.
|
int |
getPointCount() |
BlockVector |
getPrimaryPosition()
Get the primary position.
|
int |
getProtocolVersion()
Returns the CUI version that is required to send
up-to-date data.
|
Polygonal2DRegion |
getRegion()
Get the selection.
|
String |
getTypeID()
Returns the type ID to send to CUI in the selection event.
|
String |
getTypeName()
Get a lowercase name of this region selector type.
|
boolean |
isDefined()
Returns whether the region has been fully defined.
|
void |
learnChanges()
Update the selector with changes to the region.
|
boolean |
selectPrimary(Vector pos)
Called when the first point is selected.
|
boolean |
selectSecondary(Vector pos)
Called when the second point is selected.
|
@Deprecated public Polygonal2DRegionSelector(LocalWorld world)
public Polygonal2DRegionSelector(LocalWorld world, int maxPoints)
@Deprecated public Polygonal2DRegionSelector(RegionSelector oldSelector)
public Polygonal2DRegionSelector(RegionSelector oldSelector, int maxPoints)
public Polygonal2DRegionSelector(LocalWorld world, List<BlockVector2D> points, int minY, int maxY)
public boolean selectPrimary(Vector pos)
RegionSelectorselectPrimary in interface RegionSelectorpublic boolean selectSecondary(Vector pos)
RegionSelectorselectSecondary in interface RegionSelectorpublic void explainPrimarySelection(LocalPlayer player, LocalSession session, Vector pos)
RegionSelectorexplainPrimarySelection in interface RegionSelectorpublic void explainSecondarySelection(LocalPlayer player, LocalSession session, Vector pos)
RegionSelectorexplainSecondarySelection in interface RegionSelectorpublic void explainRegionAdjust(LocalPlayer player, LocalSession session)
RegionSelectorexplainRegionAdjust in interface RegionSelectorpublic BlockVector getPrimaryPosition() throws IncompleteRegionException
RegionSelectorgetPrimaryPosition in interface RegionSelectorIncompleteRegionExceptionpublic Polygonal2DRegion getRegion() throws IncompleteRegionException
RegionSelectorgetRegion in interface RegionSelectorIncompleteRegionExceptionpublic Polygonal2DRegion getIncompleteRegion()
RegionSelectorgetIncompleteRegion in interface RegionSelectorpublic boolean isDefined()
RegionSelectorisDefined in interface RegionSelectorpublic void learnChanges()
RegionSelectorlearnChanges in interface RegionSelectorpublic void clear()
RegionSelectorclear in interface RegionSelectorpublic String getTypeName()
RegionSelectorgetTypeName in interface RegionSelectorpublic List<String> getInformationLines()
RegionSelectorgetInformationLines in interface RegionSelectorpublic int getArea()
RegionSelectorgetArea in interface RegionSelectorpublic int getPointCount()
public void describeCUI(LocalSession session, LocalPlayer player)
CUIRegiondescribeCUI in interface CUIRegionpublic void describeLegacyCUI(LocalSession session, LocalPlayer player)
CUIRegiondescribeLegacyCUI in interface CUIRegionpublic int getProtocolVersion()
CUIRegiongetProtocolVersion in interface CUIRegionpublic String getTypeID()
CUIRegionpublic String getLegacyTypeID()
CUIRegiongetLegacyTypeID in interface CUIRegionCopyright © 2010-2014. All Rights Reserved.