Class Calculate
- java.lang.Object
-
- net.egartley.beyondorigins.core.logic.Calculate
-
public class Calculate extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description Calculate()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static int
getCenter(int a, int b)
Returns the "center" of b from astatic int
getCenteredX(int width)
static int
getCenteredY(int height)
static boolean
isEntityWithinToleranceOf(Entity baseEntity, Entity targetEntity, byte direction, int tolerance)
Returns whether or not the first entity is within "tolerance", or distance of, the second entity, in the specified direction (uses each entity'sEntity.defaultBoundary
)static boolean
isEntityWithinToleranceOf(EntityBoundary e1, EntityBoundary e2, byte direction, int tolerance)
Returns whether or not the first entity is within "tolerance", or distance of, the second entity, in the specified direction
-
-
-
Method Detail
-
getCenter
public static int getCenter(int a, int b)
Returns the "center" of b from a- Parameters:
a
- Base x-axis or y-axis coordinateb
- Width or height- Returns:
- a - (b / 2)
-
getCenteredX
public static int getCenteredX(int width)
-
getCenteredY
public static int getCenteredY(int height)
-
isEntityWithinToleranceOf
public static boolean isEntityWithinToleranceOf(EntityBoundary e1, EntityBoundary e2, byte direction, int tolerance)
Returns whether or not the first entity is within "tolerance", or distance of, the second entity, in the specified direction
-
isEntityWithinToleranceOf
public static boolean isEntityWithinToleranceOf(Entity baseEntity, Entity targetEntity, byte direction, int tolerance)
Returns whether or not the first entity is within "tolerance", or distance of, the second entity, in the specified direction (uses each entity'sEntity.defaultBoundary
)
-
-