Examples of RPSlot


Examples of marauroa.common.game.RPSlot

    chat = new RPEvent("chat");
    chat.put("text", "Does this work?");
    object.addEvent(chat);

    RPSlot lhand = object.getSlot("lhand");

    RPObject pocket = new RPObject();
    pocket.put("size", 1);
    pocket.addSlot("container");
    lhand.add(pocket);

    RPSlot container = pocket.getSlot("container");

    RPObject coin = new RPObject();
    coin.put("euro", 100);
    coin.put("value", 100);
    container.add(coin);

    zone = new MarauroaRPZone("test");
    /* Define the object as storable */
    object.store();

 
View Full Code Here

Examples of marauroa.common.game.RPSlot

    if (!slotOwner.hasSlot(name)) {
      logger.error("Expected to find " + name + " slot in " + slotOwner, new Throwable());
      return null;
    }

    final RPSlot slot = slotOwner.getSlot(name);

    if (slot.size() == 0) {
      logger.error("Found empty " + name + " slot" + slotOwner, new Throwable());
      return null;
    }

    return slot.iterator().next();
  }
View Full Code Here

Examples of marauroa.common.game.RPSlot

      return false;
    }
    int found = 0;
    Iterator<RPSlot> itr = player.slotsIterator();
    while (itr.hasNext()) {
      RPSlot slot = itr.next();

      for (final RPObject object : slot) {
        if (!(object instanceof Item)) {
          continue;
        }
View Full Code Here

Examples of marauroa.common.game.RPSlot

    public void propertyChange(final PropertyChangeEvent event) {
      if (event == null) {
        return;
      }
     
      RPSlot slot = (RPSlot) event.getOldValue();
      if (slot != null) {
        for (final RPObject object : slot) {
          removeMoney(slot.getName(), object);
        }
      }
     
      slot = (RPSlot) event.getNewValue();
      if (slot != null) {
        for (final RPObject object : slot) {
          // add everything. let the panel figure out if it's money
          addMoney(slot.getName(), object);
        }
      }
    }
View Full Code Here

Examples of marauroa.common.game.RPSlot

      return;
    }
    switch (at) {
    case INSPECT:
      boolean addListener = slotWindow == null;
      RPSlot content = ((Corpse) entity).getContent();
      slotWindow = inspector.inspectMe(entity, content, slotWindow, 2, 2);
      SlotWindow window = slotWindow;
      if (window != null) {
        window.setTitle(entity.getTitle());
        window.setMinimizable(false);
View Full Code Here

Examples of marauroa.common.game.RPSlot

    RPObject object = getRPObject();
    while (object != null) {
      // Prepend the items; They'll be in a nice container-slot-content
      // order for the server
      path.add(0, Integer.toString(object.getID().getObjectID()));
      RPSlot slot = object.getContainerSlot();
      if (slot != null) {
        path.add(0, slot.getName());
      }
      object = object.getContainer();
    }
    return path;
  }
View Full Code Here

Examples of marauroa.common.game.RPSlot

    RPObject object = getRPObject();
    while (object != null) {
      // Prepend the items; They'll be in a nice container-slot-content
      // order for the server
      path.add(0, Integer.toString(object.getID().getObjectID()));
      RPSlot slot = object.getContainerSlot();
      if (slot != null) {
        path.add(0, slot.getName());
      }
      object = object.getContainer();
    }
    return path;
  }
View Full Code Here

Examples of marauroa.common.game.RPSlot

  /**
   * Inspect the item. Show the slot contents.
   */
  private void inspect() {
    RPSlot slot = getContent();
    if (slotWindowWidth == 0) {
      calculateWindowProportions(slot.getCapacity());
    }
   
    boolean addListener = slotWindow == null;
    slotWindow = inspector.inspectMe(entity, slot,
        slotWindow, slotWindowWidth, slotWindowHeight);
View Full Code Here

Examples of marauroa.common.game.RPSlot

    player.addSlot(new PlayerSlot("legs"));
    player.addSlot(new PlayerSlot("feet"));
    player.addSlot(new PlayerSlot("finger"));
    player.addSlot(new PlayerSlot("cloak"));
    player.addSlot(new PlayerSlot("keyring"));
    player.addSlot(new RPSlot("!quests"));
    player.getSlot("!quests").add(new RPObject());
    player.addSlot(new RPSlot("!kills"));
    player.getSlot("!kills").add(new RPObject());
    player.addSlot(new RPSlot("!tutorial"));
    player.getSlot("!tutorial").add(new RPObject());
    player.addSlot(new RPSlot("!visited"));
    player.getSlot("!visited").add(new RPObject());
  }
View Full Code Here

Examples of marauroa.common.game.RPSlot

   */
  @Test
  public void testTransformKillSlot() {
    final Player player = PlayerTestHelper.createPlayer("player");

    RPSlot killSlot = player.getSlot("!kills");
    RPObject killStore = killSlot.getFirst();

    killStore.put("name", "solo");
    killStore.put("monster", "shared");
    killStore.put("cave_rat", "solo");

    final String oldID = killStore.get("id");

    UpdateConverter.updatePlayerRPObject(player);

    killSlot = player.getSlot("!kills");
    killStore = killSlot.getFirst();

    final String idDot = killStore.get(oldID + ".id");
    assertEquals(null, idDot);

    assertTrue(player.hasKilled("name"));
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.