Package gg.xp.xivsupport.models
Class ArenaPos
java.lang.Object
gg.xp.xivsupport.models.ArenaPos
Class to represent an arena, and divide it into cardinals and intercards.
-
Constructor Summary
ConstructorDescriptionArenaPos
(double xCenter, double yCenter, double xDiff, double yDiff) Defines the geometry of the arena. -
Method Summary
Modifier and TypeMethodDescriptionstatic ArenaSector
combatantFacing
(double heading) static ArenaSector
combatantFacing
(Position position) static ArenaSector
double
double
forCombatant
(XivCombatant cbt) forPosition
(Position pos)
-
Constructor Details
-
ArenaPos
public ArenaPos(double xCenter, double yCenter, double xDiff, double yDiff) Defines the geometry of the arena. This divides the arena into nine areas (cards, intercards, center).This definition consists of a center point, and a delta for X and Y directions. If a combatant's position is within xCenter +/- xDiff, and yCenter +/- yDiff, they are considered to be in the center of the arena.
If they are outside the xDiff but inside yDiff, they are considered to be west or east. If they are outside yDiff but inside xDiff, they are considered to be north or south. If they are outside of both, they are considered to be in an intercard.
In other words, you can visualize the sectors by drawing vertical lines at xCenter - xDiff and xCenter + xDiff, and horizontal lines at yCenter - yDiff and yCenter + yDiff. These four lines will divide the arena into nine distinct areas.
- Parameters:
xCenter
- Center X value (usually 100)yCenter
- Center Y value (usually 100)xDiff
- How far west/east away from center you can get before you're actually considered west/east.yDiff
- How far north/south away from center you can get before you're actually considered north/south.
-
-
Method Details
-
forCombatant
- Parameters:
cbt
- A combatant to compute the sector of. Must not be null.- Returns:
- The arena sector in which the combatant lies, or null if the combatant's position is null.
-
forPosition
- Parameters:
pos
- A position to compute the sector of. Must not be null.- Returns:
- The arena sector in which the position lies.
-
combatantFacing
- Parameters:
cbt
- A combatant to compute the facing angle of.- Returns:
- The facing angle expressed as a card/intercard, or 'unknown' if the combatant's position is null.
-
combatantFacing
-
combatantFacing
- Parameters:
heading
- a raw facing angle.- Returns:
- The facing angle expressed as a card/intercard, or 'unknown' if the combatant's position is null.
-
distanceFromCenter
- Parameters:
cbt
- A combatant.- Returns:
- The distance from this combatant to the center of the arena.
- Throws:
IllegalArgumentException
- if the combatant's position is null.
-
distanceFromCenter
- Parameters:
pos
- A position- Returns:
- The distance from this position to the center of the arena.
-