LazyLib

org.lazywizard.lazylib.combat
Class DefenseUtils

Object
  extended by DefenseUtils

public class DefenseUtils
extends Object

Contains methods to make working with a ship's armor grid and defenses easier.

Since:
1.5
Author:
LazyWizard

Field Summary
static float NOT_IN_GRID
          A constant that represents a point not in a ship's armor grid.
 
Method Summary
static Vector2f getArmorCellAtWorldCoord(ShipAPI ship, Vector2f loc)
          Deprecated. Use ArmorGridAPI.getCellAtLocation(Vector2f) instead.
static float getArmorDamage(ShipAPI ship, Vector2f loc)
          Get the total damage taken by a ShipAPI's armor at a location.
static float getArmorLevel(ShipAPI ship, Vector2f loc)
          Get the armor level of a ShipAPI at a location.
static float getArmorValue(ShipAPI ship, Vector2f loc)
          Get the armor value of a ShipAPI at a location.
static DefenseType getDefenseAtPoint(ShipAPI ship, Vector2f loc)
          Determine what DefenseType is present at a specific location on a ShipAPI.
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NOT_IN_GRID

public static final float NOT_IN_GRID
A constant that represents a point not in a ship's armor grid.

See Also:
Constant Field Values
Method Detail

getArmorValue

public static float getArmorValue(ShipAPI ship,
                                  Vector2f loc)
Get the armor value of a ShipAPI at a location. Equivalent to ArmorGridAPI.getArmorValue(int, int), but using world-space coordinates.

Parameters:
ship - The ShipAPI whose ArmorGridAPI we will use.
loc - The world location we will be checking the armor value at.

Returns:
The armor value at loc, or NOT_IN_GRID if the point isn't within ship's ArmorGridAPI.

Since:
1.5

getArmorDamage

public static float getArmorDamage(ShipAPI ship,
                                   Vector2f loc)
Get the total damage taken by a ShipAPI's armor at a location.

Parameters:
ship - The ShipAPI whose ArmorGridAPI we will use.
loc - The world location we will be checking the armor damage at.

Returns:
The armor damage taken at loc, or NOT_IN_GRID if the point isn't within ship's ArmorGridAPI.

Since:
1.5

getArmorLevel

public static float getArmorLevel(ShipAPI ship,
                                  Vector2f loc)
Get the armor level of a ShipAPI at a location. Equivalent to ArmorGridAPI.getArmorFraction(int, int), but using world-space coordinates.

Parameters:
ship - The ShipAPI whose ArmorGridAPI we will use.
loc - The world location we will be checking the armor level at.

Returns:
The armor level at loc, or NOT_IN_GRID if the point isn't within ship's ArmorGridAPI.

Since:
1.5

getDefenseAtPoint

public static DefenseType getDefenseAtPoint(ShipAPI ship,
                                            Vector2f loc)
Determine what DefenseType is present at a specific location on a ShipAPI.

Parameters:
ship - The ShipAPI to examine.
loc - The location to check at.

Returns:
The DefenseType present at loc.

Since:
1.5

getArmorCellAtWorldCoord

@Deprecated
public static Vector2f getArmorCellAtWorldCoord(ShipAPI ship,
                                                           Vector2f loc)
Deprecated. Use ArmorGridAPI.getCellAtLocation(Vector2f) instead.

Since:
1.5

LazyLib