Search in sources :

Example 6 with OrderedPair

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;
}
Also used : OrderedPair(pcgen.base.math.OrderedPair)

Example 7 with OrderedPair

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());
}
Also used : OrderedPair(pcgen.base.math.OrderedPair) Test(org.junit.Test)

Example 8 with OrderedPair

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))));
}
Also used : ManagerFactory(pcgen.base.formula.base.ManagerFactory) OrderedPair(pcgen.base.math.OrderedPair) Test(org.junit.Test)

Aggregations

OrderedPair (pcgen.base.math.OrderedPair)8 Test (org.junit.Test)2 LegalScope (pcgen.base.formula.base.LegalScope)2 ScopeInstance (pcgen.base.formula.base.ScopeInstance)2 FormatManager (pcgen.base.util.FormatManager)2 VarModifier (pcgen.cdom.content.VarModifier)2 ParseResult (pcgen.rules.persistence.token.ParseResult)2 DecimalFormat (java.text.DecimalFormat)1 ManagerFactory (pcgen.base.formula.base.ManagerFactory)1 ResultFacet (pcgen.cdom.facet.analysis.ResultFacet)1