Search in sources :

Example 1 with PreMoveParser

use of plugin.pretokens.parser.PreMoveParser in project pcgen by PCGen.

the class PreMoveRoundRobin method setUp.

@Override
protected void setUp() throws Exception {
    super.setUp();
    TokenRegistration.register(new PreMoveParser());
    TokenRegistration.register(new PreMoveWriter());
}
Also used : PreMoveParser(plugin.pretokens.parser.PreMoveParser) PreMoveWriter(plugin.pretokens.writer.PreMoveWriter)

Example 2 with PreMoveParser

use of plugin.pretokens.parser.PreMoveParser in project pcgen by PCGen.

the class PreMoveParserTest method testFly1.

/**
	 * @throws Exception
	 */
@Test
public void testFly1() throws Exception {
    PreMoveParser parser = new PreMoveParser();
    Prerequisite prereq = parser.parse("MOVE", "1,Fly=1", false, false);
    assertEquals("<prereq kind=\"move\" key=\"Fly\" operator=\"GTEQ\" operand=\"1\" >\n</prereq>\n", prereq.toString());
}
Also used : PreMoveParser(plugin.pretokens.parser.PreMoveParser) Prerequisite(pcgen.core.prereq.Prerequisite) Test(org.junit.Test)

Example 3 with PreMoveParser

use of plugin.pretokens.parser.PreMoveParser in project pcgen by PCGen.

the class PreMoveParserTest method testNotFlyAndWalk.

/**
	 * @throws Exception
	 */
@Test
public void testNotFlyAndWalk() throws Exception {
    PreMoveParser parser = new PreMoveParser();
    Prerequisite prereq = parser.parse("MOVE", "1,Walk=30,Fly=20", true, false);
    assertEquals("<prereq operator=\"LT\" operand=\"1\" >\n" + "<prereq kind=\"move\" count-multiples=\"true\" key=\"Walk\" operator=\"GTEQ\" operand=\"30\" >\n" + "</prereq>\n" + "<prereq kind=\"move\" count-multiples=\"true\" key=\"Fly\" operator=\"GTEQ\" operand=\"20\" >\n" + "</prereq>\n" + "</prereq>\n", prereq.toString());
}
Also used : PreMoveParser(plugin.pretokens.parser.PreMoveParser) Prerequisite(pcgen.core.prereq.Prerequisite) Test(org.junit.Test)

Example 4 with PreMoveParser

use of plugin.pretokens.parser.PreMoveParser in project pcgen by PCGen.

the class PreMoveParserTest method testNotFly1.

/**
	 * @throws Exception
	 */
@Test
public void testNotFly1() throws Exception {
    PreMoveParser parser = new PreMoveParser();
    Prerequisite prereq = parser.parse("MOVE", "1,Fly=1", true, false);
    assertEquals("<prereq kind=\"move\" key=\"Fly\" operator=\"LT\" operand=\"1\" >\n</prereq>\n", prereq.toString());
}
Also used : PreMoveParser(plugin.pretokens.parser.PreMoveParser) Prerequisite(pcgen.core.prereq.Prerequisite) Test(org.junit.Test)

Example 5 with PreMoveParser

use of plugin.pretokens.parser.PreMoveParser in project pcgen by PCGen.

the class PreMoveParserTest method testFlyAndWalk.

/**
	 * @throws Exception
	 */
@Test
public void testFlyAndWalk() throws Exception {
    PreMoveParser parser = new PreMoveParser();
    Prerequisite prereq = parser.parse("MOVE", "1,Walk=30,Fly=20", false, false);
    assertEquals("<prereq operator=\"GTEQ\" operand=\"1\" >\n" + "<prereq kind=\"move\" count-multiples=\"true\" key=\"Walk\" operator=\"GTEQ\" operand=\"30\" >\n" + "</prereq>\n" + "<prereq kind=\"move\" count-multiples=\"true\" key=\"Fly\" operator=\"GTEQ\" operand=\"20\" >\n" + "</prereq>\n" + "</prereq>\n", prereq.toString());
}
Also used : PreMoveParser(plugin.pretokens.parser.PreMoveParser) Prerequisite(pcgen.core.prereq.Prerequisite) Test(org.junit.Test)

Aggregations

PreMoveParser (plugin.pretokens.parser.PreMoveParser)5 Test (org.junit.Test)4 Prerequisite (pcgen.core.prereq.Prerequisite)4 PreMoveWriter (plugin.pretokens.writer.PreMoveWriter)1