Package marauroa.common.game

Examples of marauroa.common.game.RPObject


        assertEquals(MONEY_ID, action.getInt("baseitem"));
      }
    };

    // create a player and give him some money
    final RPObject player = createPlayer();
    player.getSlot("bag").addPreservingId(createItem("money", MONEY_ID, 100));

    // issue "/drop 50 money"
    final DropAction action = new DropAction();
    assertTrue(action.execute(new String[]{"50"}, "money"));
    assertEquals("", clientUI.getEventBuffer());
View Full Code Here


        assertEquals(SILVER_SWORD_ID, action.getInt("baseitem"));
      }
    };

    // create a player and give him some money
    final RPObject player = createPlayer();
    player.getSlot("bag").addPreservingId(createItem("silver sword", SILVER_SWORD_ID, 1));

    // issue "/drop money"
    final DropAction action = new DropAction();
    assertTrue(action.execute(new String[]{"silver"}, "sword"));
    assertEquals("", clientUI.getEventBuffer());
View Full Code Here

  @Test
  public void testOnAction() {

    final StopAction sa = new StopAction();
    PlayerTestHelper.generatePlayerRPClasses();
    final Player player = new Player(new RPObject()) {
      @Override
      public void stopAttack() {
        stopattack = true;

      }
View Full Code Here

  }


  @Test
  public final void carrot() {
    final RPObject rp = new MockRPObject("growing_entity_spawner",
        "items/grower/carrot_grower", "carrot");
    rp.put("max_ripeness", 1);
    rp.put("width", 1);
    rp.put("height", 1);
    final IEntity en = EntityFactory.createEntity(rp);
    assertNotNull("entity should be created", en);
    assertEquals("we should have created a Carrotgrower now",
        CarrotGrower.class, en.getClass());
  }
View Full Code Here

        CarrotGrower.class, en.getClass());
  }

  @Test
  public final void grainfield() {
    RPObject rp = new MockRPObject("growing_entity_spawner", null, null);
    rp.put("max_ripeness", 1);
    rp.put("width", 1);
    rp.put("height", 1);
    IEntity en = EntityFactory.createEntity(rp);
    assertNotNull("entity should be created", en);
    assertEquals("we should have created a Grainfield now",
        GrainField.class, en.getClass());

    rp = new MockRPObject("growing_entity_spawner", null, null);
    rp.put("max_ripeness", 1);
    rp.put("width", 1);
    rp.put("height", 1);
    en = EntityFactory.createEntity(rp);
    assertNotNull("entity should be created", en);
    assertEquals("we should have created a Grainfield now",
        GrainField.class, en.getClass());
  }
View Full Code Here

        GrainField.class, en.getClass());
  }

  @Test
  public final void apple() {
    final RPObject rp = new MockRPObject("item", "food", "apple");
    final IEntity en = EntityFactory.createEntity(rp);
    assertNotNull("entity should be created", en);
    assertEquals("we should have created an item by now", UseableItem.class, en
        .getClass());
View Full Code Here

  }
 
  @Test
  public final void seed() {
    final RPObject rp = new MockRPObject("item", "misc", "seed");
    final IEntity en = EntityFactory.createEntity(rp);
    assertNotNull("entity should be created", en);
    assertEquals("we should have created a Useableitem by now", UseableItem.class, en
        .getClass());
View Full Code Here

  }

  @Test
  public final void box() {
    final RPObject rp = new MockRPObject("item", "box");
    final IEntity en = EntityFactory.createEntity(rp);
    assertNotNull("entity should be created", en);
    assertEquals("we should have created a box by now", Box.class, en
        .getClass());
  }
View Full Code Here

        .getClass());
  }

  @Test
  public final void player() {
    final RPObject rp = new MockRPObject("player", null);
    final IEntity en = EntityFactory.createEntity(rp);
    assertNotNull("entity should be created", en);
    assertEquals("we should have created a player by now", Player.class, en
        .getClass());
  }
View Full Code Here

        .getClass());
  }

  @Test
  public final void creature() {
    final RPObject rp = new MockRPObject("creature", null);
    rp.put("height", 1);
    rp.put("width", 1);
    final IEntity en = EntityFactory.createEntity(rp);
    assertNotNull("entity should be created", en);
    assertEquals("we should have created a Creature by now",
        Creature.class, en.getClass());
  }
View Full Code Here

TOP

Related Classes of marauroa.common.game.RPObject

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.