Package marauroa.common.game

Examples of marauroa.common.game.IRPZone


  private Perception getPlayerPerception(PlayerEntry entry) {
    Perception perception = null;

    IRPZone.ID id = new IRPZone.ID(entry.object.get("zoneid"));
    IRPZone zone = world.getRPZone(id);

    if (entry.requestedSync == false) {
      perception = zone.getPerception(entry.object, Perception.DELTA);
    } else {
      entry.requestedSync = false;
      perception = zone.getPerception(entry.object, Perception.SYNC);
    }

    return perception;
  }
View Full Code Here


   * @param zoneid
   * @return the zone removed or null if not found
   * @throws Exception caused by onFinish
   */
  public IRPZone removeRPZone(IRPZone.ID zoneid) throws Exception {
    IRPZone zone=zones.remove(zoneid);
   
    if(zone!=null) {
      zone.onFinish();
    }
   
    return zone;
  }
View Full Code Here

   * @return the zone removed or null if not found
   * @throws Exception caused by onFinish
   */
  public IRPZone removeRPZone(RPObject.ID objectid) throws Exception {
    IRPZone.ID zoneid=new IRPZone.ID(objectid.getZoneID());
    IRPZone zone=zones.remove(zoneid);
   
    if(zone!=null) {
      zone.onFinish();
    }
   
    return zone;
  }
View Full Code Here

   *            the object to add
   */
  public void add(RPObject object) {
    String zoneid = object.get("zoneid");
    if (zoneid != null) {
      IRPZone zone = zones.get(new IRPZone.ID(zoneid));
      if (zone == null) {
        logger.error("Unknown zone: " + zoneid);
        return;
      }
      zone.assignRPObjectID(object);

      zone.add(object);
    }
  }
View Full Code Here

   * @param id
   *            the object's id
   * @return the object
   */
  public RPObject get(RPObject.ID id) {
    IRPZone zone = zones.get(new IRPZone.ID(id.getZoneID()));
    return zone.get(id);
  }
View Full Code Here

   * @param id
   *            the object's id
   * @return true if the object exists
   */
  public boolean has(RPObject.ID id) {
    IRPZone zone = zones.get(new IRPZone.ID(id.getZoneID()));
    return zone.has(id);
  }
View Full Code Here

   * @param id
   *            the object's id
   * @return the object or null if it not found.
   */
  public RPObject remove(RPObject.ID id) {
    IRPZone zone = zones.get(new IRPZone.ID(id.getZoneID()));
    if (zone != null) {
      return zone.remove(id);
    }

    logger.error("Cannot remove rpobject with id " + id + " from zone because there is no zone with that name in the RPWorld");
    return null;
  }
View Full Code Here

   *
   * @param object
   *            the object that has been modified.
   */
  public void modify(RPObject object) {
    IRPZone zone = zones.get(new IRPZone.ID(object.get("zoneid")));
    if (zone != null) {
      zone.modify(object);
    } else {
      logger.warn("calling RPWorld.modify on a zoneless object: " + object + " parent: " + object.getContainerBaseOwner(), new Throwable());
    }
  }
View Full Code Here

    populate();
  }

  protected void populate() {
    IRPZone zone = new MarauroaRPZone("test");
    addRPZone(zone);

    RPObject hidden = new RPObject();
    zone.assignRPObjectID(hidden);
    hidden.put("hidden", "You don't see this object");
    hidden.hide();
    zone.add(hidden);
  }
View Full Code Here

    assertThat(regionWofolExteriors.isEmpty(), is(Boolean.TRUE));
    Collection<StendhalRPZone> regionWofolInteriors = world.getAllZonesFromRegion("wofol city", Boolean.FALSE, Boolean.FALSE, Boolean.TRUE);
    assertThat(regionWofolInteriors.isEmpty(), is(Boolean.FALSE));
    assertThat(regionWofolInteriors.size(), is(19));
    Collection<StendhalRPZone> regionSemosInteriors = world.getAllZonesFromRegion("semos", Boolean.FALSE, Boolean.FALSE, Boolean.TRUE);
    IRPZone rpZone = world.getRPZone("int_semos_house");
    assertThat(regionSemosInteriors.contains(rpZone), is(Boolean.FALSE));
  }
View Full Code Here

TOP

Related Classes of marauroa.common.game.IRPZone

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.