Examples of Engine


Examples of games.stendhal.server.entity.npc.fsm.Engine

   * Tests for baking multiple breads.
   */
  @Test
  public void testBakeMultipleBreads() {
    final SpeakerNPC npc = getNPC("Erna");
    final Engine en = npc.getEngine();
   
    en.step(player, "hi");
    assertTrue(npc.isTalking());
    assertEquals(
        "Welcome to the Semos bakery! We'll #bake fine bread for anyone who helps bring our #flour delivery from the mill.",
        getReply(npc));
    final StackableItem flour = new StackableItem("flour", "", "", null);
    flour.setQuantity(4);
    flour.setID(new ID(2, ZONE_NAME));
    player.getSlot("bag").add(flour);
    assertEquals(4, player.getNumberOfEquipped("flour"));

    en.step(player, "make 2 breads");
    assertTrue(npc.isTalking());
    assertEquals(
        "I need you to fetch me 4 #'sacks of flour' for this job. Do you have it?",
        getReply(npc));
    en.step(player, "yes");
    final String[] questStatus = player.getQuest(QUEST1).split(";");
    final String[] expected = { "2", "bread", "" };
    assertEquals("amount", expected[0], questStatus[0]);
    assertEquals("item", expected[1], questStatus[1]);

    assertTrue(npc.isTalking());
    assertEquals(
        "OK, I will bake 2 loaves of bread for you, but that will take some time. Please come back in 20 minutes.",
        getReply(npc));
    assertEquals(0, player.getNumberOfEquipped("flour"));
    assertEquals(0, player.getNumberOfEquipped("bread"));
    en.step(player, "bye");
    assertFalse(npc.isTalking());
    player.setQuest(QUEST1, "2;;0");

    en.step(player, "hi");
    assertEquals(
        "Welcome back! I'm done with your order. Here you have 2 loaves of bread.",
        getReply(npc));
    assertEquals(2, player.getNumberOfEquipped("bread"));
  }
View Full Code Here

Examples of games.stendhal.server.entity.npc.fsm.Engine

   * Tests for baking multiple breads without naming them.
   */
  @Test
  public void testBakeMultipleWithoutName() {
    final SpeakerNPC npc = getNPC("Erna");
    final Engine en = npc.getEngine();
   
    en.step(player, "hi");
    assertTrue(npc.isTalking());
    assertEquals(
        "Welcome to the Semos bakery! We'll #bake fine bread for anyone who helps bring our #flour delivery from the mill.",
        getReply(npc));
    final StackableItem flour = new StackableItem("flour", "", "", null);
    flour.setQuantity(6);
    flour.setID(new ID(2, ZONE_NAME));
    player.getSlot("bag").add(flour);
    assertEquals(6, player.getNumberOfEquipped("flour"));

    en.step(player, "make 3");
    assertTrue(npc.isTalking());
    assertEquals(
        "I need you to fetch me 6 #'sacks of flour' for this job. Do you have it?",
        getReply(npc));
    en.step(player, "yes");
    final String[] questStatus = player.getQuest(QUEST1).split(";");
    final String[] expected = { "3", "bread", "" };
    assertEquals("amount", expected[0], questStatus[0]);
    assertEquals("item", expected[1], questStatus[1]);

    assertTrue(npc.isTalking());
    assertEquals(
        "OK, I will bake 3 loaves of bread for you, but that will take some time. Please come back in 30 minutes.",
        getReply(npc));
    assertEquals(0, player.getNumberOfEquipped("flour"));
    assertEquals(0, player.getNumberOfEquipped("bread"));
    en.step(player, "bye");
    assertFalse(npc.isTalking());
    player.setQuest(QUEST1, "3;;0");

    en.step(player, "hi");
    assertEquals(
        "Welcome back! I'm done with your order. Here you have 3 loaves of bread.",
        getReply(npc));
    assertEquals(3, player.getNumberOfEquipped("bread"));
  }
View Full Code Here

Examples of games.stendhal.server.entity.npc.fsm.Engine

   * Tests for borrowing the sugar mill.
   */
  @Test
  public void testBorrowSugarMill() {
    final SpeakerNPC npc = getNPC("Erna");
    final Engine en = npc.getEngine();
   
    en.step(player, "hi");
    assertTrue(npc.isTalking());
    assertEquals(
        "Welcome to the Semos bakery! We'll #bake fine bread for anyone who helps bring our #flour delivery from the mill.",
        getReply(npc));

    en.step(player, "borrow");
    assertTrue(npc.isTalking());
    assertEquals(
        "Oh sorry, I don't lend equipment to people with so little experience as you.",
        getReply(npc));

    // level up
    player.setLevel(10);
    en.step(player, "borrow");
    assertTrue(npc.isTalking());
    assertEquals(
        "You'll have to speak to Leander and ask if you can help with the pizza before I'm allowed to lend you anything.",
        getReply(npc));

    player.setQuest("pizza_delivery", "done");
    en.step(player, "borrow");
    assertTrue(npc.isTalking());
    assertEquals(
        "I lend out #'sugar mill' and #'pestle and mortar'. If you're interested, please say which you want.",
        getReply(npc));

    en.step(player, "sugar mill");
    assertTrue(npc.isTalking());
    assertEquals(
        "Here you are! Don't forget to #return it or you have to pay!",
        getReply(npc));
    final String[] questStatus = player.getQuest(QUEST2).split(";");
    assertEquals("sugar mill", questStatus[0]);

    en.step(player, "bye");
    assertFalse(npc.isTalking());
    player.setQuest(QUEST2, ";");

    assertEquals(1, player.getNumberOfEquipped("sugar mill"));

    en.step(player, "hi");
    assertEquals(
        "Welcome to the Semos bakery! We'll #bake fine bread for anyone who helps bring our #flour delivery from the mill.",
        getReply(npc));
  }
View Full Code Here

Examples of httl.Engine

  }

  @SuppressWarnings("unchecked")
  @Test
  public void testTemplate() throws Exception {
    Engine engine = Engine.getEngine(config);
    Loader loader = engine.getProperty("loader", Loader.class);
    assertEquals(MultiLoader.class, loader.getClass());
    Loader[] loaders = engine.getProperty("loaders", Loader[].class);
    assertEquals(ClasspathLoader.class, loaders[0].getClass());
    loader = engine.getProperty("loaders", ClasspathLoader.class);
    assertEquals(ClasspathLoader.class, loader.getClass());
    String[] suffixes = engine.getProperty("template.suffix", new String[] { ".httl" });
    List<String> list = loader.list(suffixes[0]);
    assertTrue(list.size() > 0);
    String dir = engine.getProperty("template.directory", "");
    if (dir.length() > 0 && dir.startsWith("/")) {
      dir = dir.substring(1);
    }
    if (dir.length() > 0 && ! dir.endsWith("/")) {
      dir += "/";
    }
    System.out.println(config + ": " + (data == null ? "null" : data.getClass().getSimpleName()) + " => " + templateName);
    String encoding = "UTF-8";
    if ("gbk.httl".equals(templateName)) {
      encoding = "GBK";
    }
    Engine _engine = engine;
    if ("extends_default.httl".equals(templateName)) {
      _engine = Engine.getEngine("httl-comment-extends.properties");
    }
    Template template = _engine.getTemplate("/templates/" + templateName, Locale.CHINA, encoding, data);
    UnsafeByteArrayOutputStream actualStream = new UnsafeByteArrayOutputStream();
    StringWriter actualWriter = new StringWriter();
    if ("extends_var.httl".equals(templateName)) {
      if (data instanceof Map) {
        ((Map<String, Object>) data).put("extends", "default.httl");
View Full Code Here

Examples of hudson.remoting.Engine

    /**
     * If the current JVM runs a {@link MainDialog} as a JNLP slave agent,
     * return its reference, otherwise null.
     */
    public static MainDialog get() {
        Engine e = Engine.current();
        if(e==null)     return null;
        if (!(e.listener instanceof GuiListener))   return null;
        return ((GuiListener) e.listener).frame;
    }
View Full Code Here

Examples of it.eng.spagobi.engines.config.bo.Engine

     
      proxy.setBiObject(object);
     

      // if engine is Birt, export in PDF, elsewhere in JPG
      Engine engine = object.getEngine();
      String driverName = engine.getDriverName();
      if (driverName != null && driverName.endsWith("BirtReportDriver")) {
        output = "PDF";
      } else {
        output = "JPG";
      }
View Full Code Here

Examples of megamek.common.Engine

            int engineFlags = 0;
            if ((techType == TechType.CLAN) || (engineTechType == TechType.CLAN)) {
                engineFlags = Engine.CLAN_ENGINE;
            }
            mech.setEngine(new Engine(engineRating, Engine
                            .getEngineTypeByString(engineType.toString()),
                            engineFlags));

            mech.setOriginalJumpMP(jumpMP);
View Full Code Here

Examples of net.paoding.rose.web.impl.thread.Engine

    }

    private void addController(Module module, MappingNode moduleNode, LinkedEngine moduleEngine,
            ControllerRef controller) {
        //
        Engine engine = new ControllerEngine(module, controller);

        Set<String> mappingPaths = new HashSet<String>(Arrays.asList(controller.getMappingPaths()));
        for (String mappingPath : mappingPaths) {
            List<Mapping> mappings = MappingFactory.parse(mappingPath);
            //
View Full Code Here

Examples of net.pyxzl.orayen.engine.Engine

    final PluginLoader pl = new PluginLoader(urls);
    pl.loadDependencies();
    pl.loadPlugins();
   
    // Load the main Engine
    new Engine();
  }
View Full Code Here

Examples of net.riccardocossu.autodoc.main.Engine

    BaseConfiguration conf = new BaseConfiguration();
    conf.addProperty(Engine.CONFIG_PACKAGES, packages);
    conf.addProperty(Engine.CONFIG_INPUT_PLUGINS, inputPlugins);
    conf.addProperty(Engine.CONFIG_OUTPUT_PLUGINS, outputPlugins);
    conf.addProperty(Engine.CONFIG_BASE_OUTPUT_DIR, f.getAbsolutePath());
    Engine eng = new Engine(conf);
    List<PackageContainer> parsedPackages = eng.execute();
    getLog().info(
        String.format("Parsed %d packages", parsedPackages.size()));
  }
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.