Package games.stendhal.common.parser

Examples of games.stendhal.common.parser.NameSearch.found()


      return new ItemParserResult(false, chosenName, amount, null);
    }

    NameSearch search = sentence.findMatchingName(itemNames);

    boolean found = search.found();

    // Store found name.
    String chosenName = search.getName();
    int amount = search.getAmount();
    Set<String> mayBeItems = null;
View Full Code Here


    names.add("pestle");
    names.add("mortar");
    names.add("cow");
    names.add("horse");
    NameSearch found = sentence.findMatchingName(names);
    assertTrue(found.found());
    assertEquals(1, found.getAmount());
    assertEquals("horse", found.getName());
  }

  /**
 
View Full Code Here

    assertEquals("i/SUB-PRO own/VER pig/OBJ-ANI-PLU, cow/OBJ-ANI, horse/SUB-ANI.", sentence.toString());

    Set<String> names = new HashSet<String>();
    names.add("horses");
    NameSearch found = sentence.findMatchingName(names);
    assertTrue(found.found());
    assertEquals(1, found.getAmount());
    assertEquals("horses", found.getName());

    names = new HashSet<String>();
    names.add("pig");
View Full Code Here

    assertEquals("horses", found.getName());

    names = new HashSet<String>();
    names.add("pig");
    found = sentence.findMatchingName(names);
    assertTrue(found.found());
    assertEquals(2, found.getAmount());
    assertEquals("pig", found.getName());

    names = new HashSet<String>();
    names.add("pigs");
View Full Code Here

    assertEquals("pig", found.getName());

    names = new HashSet<String>();
    names.add("pigs");
    found = sentence.findMatchingName(names);
    assertTrue(found.found());
    assertEquals(2, found.getAmount());
    assertEquals("pigs", found.getName());
  }
}
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.