java.lang.Object
com.gw2tb.gw2ml.MumbleLink.Context
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
The number of bytes that are used to store the context in the underlying data. -
Method Summary
Modifier and TypeMethodDescriptionvoid
copy
(byte[] dest) Shorthand forcopy(0, dest, 0, BYTES)
.void
copy
(int srcOffset, byte[] dest, int destOffset, int length) Copies the underlying data beginning at the specified offset, to the specified offset of the destination array.void
copy
(int srcOffset, MemorySegment dest, int destOffset, int length) Copies the underlying data beginning at the specified offset, to the specified offset of the destination segment.void
copy
(int srcOffset, ByteBuffer dest, int destOffset, int length) Deprecated, for removal: This API element is subject to removal in a future version.void
copy
(MemorySegment dest) Shorthand forcopy(0, dest, 0, BYTES)
.void
copy
(ByteBuffer dest) Deprecated, for removal: This API element is subject to removal in a future version.This method is deprecated in favor ofcopy(MemorySegment)
.long
Returns the ID of the game build that is currently running (as per Guild Wars 2 API).int
Returns the height of the compass in pixels.float
Returns the rotation of the compass in radians.int
Returns the width of the compass in pixels.long
Returns the ID of the current game instance.float
Returns theX
-component of the position at the center of the map.float
Returns theY
-component of the position at the center of the map.long
getMapID()
Returns the ID of the map the player is currently on (as per Guild Wars 2 API).float
Returns the scale of the map.long
Returns information about the type of the map the player is currently on.byte
Returns information about the type of the mount the player is currently riding.float
Returns theX
-component of the position of the player in continent coordinates.float
Returns theY
-component of the position of the player in continent coordinates.long
Returns the ID of the process.@Nullable InetSocketAddress
Returns the address of the map server that the game client is currently connected to.int
Returns a 32bit bitfield that contains various information about the current game shard.int
Returns a 32bit bitfield that contains various information about the current state of the game UI.
-
Field Details
-
BYTES
public static final int BYTESThe number of bytes that are used to store the context in the underlying data.- Since:
- 0.1.0
- See Also:
-
-
Method Details
-
copy
public void copy(byte[] dest) Shorthand forcopy(0, dest, 0, BYTES)
.- Parameters:
dest
- the destination array- Throws:
IllegalStateException
- if this view wasinvalidated
IndexOutOfBoundsException
- if any index is violatedNullPointerException
- ifdest
isnull
- Since:
- 0.1.0
-
copy
Deprecated, for removal: This API element is subject to removal in a future version.This method is deprecated in favor ofcopy(MemorySegment)
.Shorthand forcopy(0, dest, 0, BYTES)
.- Parameters:
dest
- the destination buffer- Throws:
IllegalStateException
- if this view wasinvalidated
IndexOutOfBoundsException
- if any index is violatedNullPointerException
- ifdest
isnull
- Since:
- 1.3.0
-
copy
Shorthand forcopy(0, dest, 0, BYTES)
.- Parameters:
dest
- the destination segment- Throws:
IllegalStateException
- if this view wasinvalidated
IndexOutOfBoundsException
- if any index is violatedNullPointerException
- ifdest
isnull
- Since:
- 3.0.0
-
copy
public void copy(int srcOffset, byte[] dest, int destOffset, int length) Copies the underlying data beginning at the specified offset, to the specified offset of the destination array.If any of the following is true, an IndexOutOfBoundsException is thrown and the destination is not modified:
- The
srcOffset
argument is negative. - The
destOffset
argument is negative. - The
length
argument is negative. srcOffset + length
is greater thanBYTES
, the length of the contextdestOffset + length
is greater thandest.length
, the length of the destination array.
- Parameters:
srcOffset
- starting position in the contextdest
- the destination arraydestOffset
- starting position in the destination datalength
- the number of bytes to be copied- Throws:
IllegalStateException
- if this view wasinvalidated
IndexOutOfBoundsException
- if any index is violatedNullPointerException
- ifdest
isnull
- Since:
- 0.1.0
- The
-
copy
@Deprecated(since="3.0.0", forRemoval=true) public void copy(int srcOffset, ByteBuffer dest, int destOffset, int length) Deprecated, for removal: This API element is subject to removal in a future version.This method is deprecated in favor ofcopy(int, MemorySegment, int, int)
.Copies the underlying data beginning at the specified offset, to the specified offset of the destination buffer.If any of the following is true, an IndexOutOfBoundsException is thrown and the destination is not modified:
- The
srcOffset
argument is negative. - The
destOffset
argument is negative. - The
length
argument is negative. srcOffset + length
is greater thanBYTES
, the length of the contextdestOffset + length
is greater thandest.length
, the length of the destination buffer.
- Parameters:
srcOffset
- starting position in the contextdest
- the destination bufferdestOffset
- starting position in the destination datalength
- the number of bytes to be copied- Throws:
IllegalStateException
- if this view wasinvalidated
IndexOutOfBoundsException
- if any index is violatedNullPointerException
- ifdest
isnull
- Since:
- 1.3.0
- The
-
copy
Copies the underlying data beginning at the specified offset, to the specified offset of the destination segment.If any of the following is true, an IndexOutOfBoundsException is thrown and the destination is not modified:
- The
srcOffset
argument is negative. - The
destOffset
argument is negative. - The
length
argument is negative. srcOffset + length
is greater thanBYTES
, the length of the contextdestOffset + length
is greater thandest.length
, the length of the destination buffer.
- Parameters:
srcOffset
- starting position in the contextdest
- the destination segmentdestOffset
- starting position in the destination datalength
- the number of bytes to be copied- Throws:
IllegalStateException
- if this view wasinvalidated
IndexOutOfBoundsException
- if any index is violatedNullPointerException
- ifdest
isnull
- Since:
- 3.0.0
- The
-
getServerAddress
Returns the address of the map server that the game client is currently connected to.- Returns:
- the address of the map server that the game client is currently connected to
- Throws:
IllegalStateException
- if this view wasinvalidated
- Since:
- 0.1.0
-
getMapID
public long getMapID()Returns the ID of the map the player is currently on (as per Guild Wars 2 API).- Returns:
- the ID of the map the player is currently on
- Throws:
IllegalStateException
- if this view wasinvalidated
- Since:
- 0.1.0
-
getMapType
public long getMapType()Returns information about the type of the map the player is currently on.The functionality provided by
MapType
may be used to interpret the value.- Returns:
- information about the type of the map the player is currently on
- Throws:
IllegalStateException
- if this view wasinvalidated
- Since:
- 0.1.0
-
getShardID
public int getShardID()Returns a 32bit bitfield that contains various information about the current game shard.- Returns:
- a 32bit bitfield that contains various information about the current game shard
- Throws:
IllegalStateException
- if this view wasinvalidated
- Since:
- 1.0.0
- API Note:
- This field has no known purpose for outside use.
-
getInstance
public long getInstance()Returns the ID of the current game instance.- Returns:
- the ID of the current game instance
- Throws:
IllegalStateException
- if this view wasinvalidated
- Since:
- 0.1.0
- API Note:
- This field has no known purpose for outside use.
-
getBuildID
public long getBuildID()Returns the ID of the game build that is currently running (as per Guild Wars 2 API).- Returns:
- the ID of the game build that is currently running
- Throws:
IllegalStateException
- if this view wasinvalidated
- Since:
- 0.1.0
-
getUIState
public int getUIState()Returns a 32bit bitfield that contains various information about the current state of the game UI.The functionality provided by
UIState
may be used to interpret the value of the bitfield.- Returns:
- a 32bit bitfield that contains various information about the current state of the game UI
- Throws:
IllegalStateException
- if this view wasinvalidated
- Since:
- 0.1.0
-
getCompassWidth
public int getCompassWidth()Returns the width of the compass in pixels.- Returns:
- the width of the compass in pixels
- Throws:
IllegalStateException
- if this view wasinvalidated
- Since:
- 0.1.0
-
getCompassHeight
public int getCompassHeight()Returns the height of the compass in pixels.- Returns:
- the height of the compass in pixels
- Throws:
IllegalStateException
- if this view wasinvalidated
- Since:
- 0.1.0
-
getCompassRotation
public float getCompassRotation()Returns the rotation of the compass in radians.- Returns:
- the rotation of the compass in radians
- Throws:
IllegalStateException
- if this view wasinvalidated
- Since:
- 0.1.0
-
getPlayerX
public float getPlayerX()Returns theX
-component of the position of the player in continent coordinates.- Returns:
- the
X
-component of the position of the player in continent coordinates - Throws:
IllegalStateException
- if this view wasinvalidated
- Since:
- 0.1.0
-
getPlayerY
public float getPlayerY()Returns theY
-component of the position of the player in continent coordinates.- Returns:
- the
Y
-component of the position of the player in continent coordinates - Throws:
IllegalStateException
- if this view wasinvalidated
- Since:
- 0.1.0
-
getMapCenterX
public float getMapCenterX()Returns theX
-component of the position at the center of the map.- Returns:
- the
X
-component of the position at the center of the map - Throws:
IllegalStateException
- if this view wasinvalidated
- Since:
- 0.1.0
-
getMapCenterY
public float getMapCenterY()Returns theY
-component of the position at the center of the map.- Returns:
- the
Y
-component of the position at the center of the map - Throws:
IllegalStateException
- if this view wasinvalidated
- Since:
- 0.1.0
-
getMapScale
public float getMapScale()Returns the scale of the map.- Returns:
- the scale of the map
- Throws:
IllegalStateException
- if this view wasinvalidated
- Since:
- 0.1.0
-
getProcessID
public long getProcessID()Returns the ID of the process.- Returns:
- the ID of the process
- Throws:
IllegalStateException
- if this view wasinvalidated
- Since:
- 1.4.0
-
getMountType
public byte getMountType()Returns information about the type of the mount the player is currently riding.The functionality provided by
MountType
may be used to interpret the value.- Returns:
- information about the type of the mount the player is currently riding
- Throws:
IllegalStateException
- if this view wasinvalidated
- Since:
- 1.5.0
-
copy(int, MemorySegment, int, int)
.