endstone::MapView
Represents a map item.
Types:
Name | Description |
---|---|
Scale | An enum representing all possible scales a map can be set to. |
Functions:
Name | Description |
---|---|
addRenderer | Add a renderer to this map. |
getCenterX | Get the center X position of this map. |
getCenterZ | Get the center Z position of this map. |
getDimension | Get the dimension that this map is associated with. |
getId | Get the ID of this map item for use with MapMeta . |
getRenderers | Get a list of MapRenderers currently in effect. |
getScale | Get the scale of this map. |
isLocked | Gets whether the map is locked or not. A locked map may not be explored further. |
isUnlimitedTracking | Whether the map will show a smaller position cursor (true), or no position cursor (false) when cursor is outside of map’s range. |
isVirtual | Check whether this map is virtual. |
removeRenderer | Remove a renderer from this map. |
setCenterX | Set the center X position of this map. |
setCenterZ | Set the center Z position of this map. |
setDimension | Set the dimension that this map is associated with. |
setLocked | Sets whether the map is locked or not. A locked map may not be explored further. |
setScale | Set the scale of this map. |
setUnlimitedTracking | Whether the map will show a smaller position cursor (true), or no position cursor (false) when cursor is outside of map’s range. |
Scale
enum Scale { Closest = 0, Close = 1, Normal = 2, Far = 3, Farthest = 4 };
An enum representing all possible scales a map can be set to.
addRenderer
void addRenderer(std::shared_ptr<MapRenderer> renderer)
Add a renderer to this map.
Parameters:
renderer
The MapRenderer to add.
getCenterX
int getCenterX() const
Get the center X position of this map.
Returns:
The center X position.
getCenterZ
int getCenterZ() const
Get the center Z position of this map.
Returns:
The center Z position.
getDimension
Dimension *getDimension() const
Get the dimension that this map is associated with.
Returns:
Pointer to the World this map is associated with, or nullptr.
getId
std::int64_t getId() const
Get the ID of this map item for use with MapMeta .
Returns:
The unique ID of the map.
getRenderers
std::vector<MapRenderer *> getRenderers() const
Get a list of MapRenderers currently in effect.
Returns:
A list of references to each MapRenderer.
getScale
Scale getScale() const
Get the scale of this map.
Returns:
The scale of the map.
isLocked
bool isLocked() const
Gets whether the map is locked or not. A locked map may not be explored further.
Returns:
True if the map is locked.
isUnlimitedTracking
bool isUnlimitedTracking() const
Whether the map will show a smaller position cursor (true), or no position cursor (false) when cursor is outside of map’s range.
Returns:
True if unlimited tracking is enabled.
isVirtual
bool isVirtual() const
Check whether this map is virtual.
A map is virtual if its lowermost MapRenderer is plugin-provided.
Returns:
True if the map is virtual.
removeRenderer
bool removeRenderer(MapRenderer *renderer)
Remove a renderer from this map.
Parameters:
renderer
The MapRenderer to remove.
Returns:
True if the renderer was successfully removed.
setCenterX
void setCenterX(int x)
Set the center X position of this map.
Parameters:
x
The center X position.
setCenterZ
void setCenterZ(int z)
Set the center Z position of this map.
Parameters:
z
The center Z position.
setDimension
void setDimension(const Dimension &dimension)
Set the dimension that this map is associated with.
Parameters:
dimension
The Dimension to associate this map with.
setLocked
void setLocked(bool locked)
Sets whether the map is locked or not. A locked map may not be explored further.
Parameters:
locked
True to lock the map.
setScale
void setScale(Scale scale)
Set the scale of this map.
Parameters:
scale
The scale to set.
setUnlimitedTracking
void setUnlimitedTracking(bool unlimited)
Whether the map will show a smaller position cursor (true), or no position cursor (false) when cursor is outside of map’s range.
Parameters:
unlimited
True to enable unlimited tracking.