use of pcgen.base.math.OrderedPair in project pcgen by PCGen.
the class FaceToken method getFaceToken.
/**
* Get FACE Token
* @param display
* @return FACE Token
*/
public static String getFaceToken(CharacterDisplay display) {
OrderedPair face = getFace(display.getCharID());
String retString = "";
if (CoreUtility.doublesEqual(face.getPreciseY().doubleValue(), 0.0)) {
retString = Globals.getGameModeUnitSet().displayDistanceInUnitSet(face.getPreciseX().doubleValue()) + Globals.getGameModeUnitSet().getDistanceUnit();
} else {
retString = Globals.getGameModeUnitSet().displayDistanceInUnitSet(face.getPreciseX().doubleValue()) + Globals.getGameModeUnitSet().getDistanceUnit() + " by " + Globals.getGameModeUnitSet().displayDistanceInUnitSet(face.getPreciseY().doubleValue()) + Globals.getGameModeUnitSet().getDistanceUnit();
}
return retString;
}
use of pcgen.base.math.OrderedPair in project pcgen by PCGen.
the class OrderedPairTest method testValueOf.
@Test
public void testValueOf() {
OrderedPair gp = OrderedPair.valueOf("4,6");
assertEquals(4, gp.getPreciseX());
assertEquals(6, gp.getPreciseY());
assertEquals("4,6", gp.toString());
}
use of pcgen.base.math.OrderedPair in project pcgen by PCGen.
the class SetOrderedPairModifierTest method testGetModifier.
@Test
public void testGetModifier() {
ModifierFactory<OrderedPair> factory = new SetModifierFactory();
Modifier<OrderedPair> modifier = factory.getModifier(5, "3,2", new ManagerFactory() {
}, null, varScope, opManager);
assertEquals(5L << 32, modifier.getPriority());
assertSame(OrderedPair.class, modifier.getVariableFormat());
assertEquals(new OrderedPair(3, 2), modifier.process(EvalManagerUtilities.getInputEM(new OrderedPair(5, 6))));
}
Aggregations