Package org.ggp.base.util.gdl.grammar

Examples of org.ggp.base.util.gdl.grammar.GdlSentence


        for(GdlSentence stateFact : gameState.getContents()) {
            if(stateFact.getBody().size() > 1)
                continue;

            GdlSentence theRealSentence = stateFact.getBody().get(0).toSentence();
            if(theRealSentence.getName().toString().equals("cell")) {
                int xCell = Integer.parseInt(theRealSentence.getBody().get(0).toString());
                int yCell = Integer.parseInt(theRealSentence.getBody().get(1).toString());
                char mark = theRealSentence.getBody().get(2).toString().charAt(0);

                int xSpot = (xCell-1)*width/3 + 2;
                int ySpot = (yCell-1)*height/3 + 2;

                g.setColor(Color.BLACK);
View Full Code Here


import org.junit.Test;

public class SimpleSentenceFormTest extends Assert {
  @Test
  public void testFunctionNesting() throws Exception {
    GdlSentence sentence = (GdlSentence) GdlFactory.create("(does player (combine foo (bar b b)))");
    SimpleSentenceForm form = SimpleSentenceForm.create(sentence);
    assertEquals(GdlPool.DOES, form.getName());
    assertEquals(4, form.getTupleSize());
    assertTrue(form.matches(sentence));
View Full Code Here

TOP

Related Classes of org.ggp.base.util.gdl.grammar.GdlSentence

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.