Package org.groovymud.object

Examples of org.groovymud.object.ObjectLocation


  }

  public void movePlayerToLocation(Player player) throws InstantiationException, FileNotFoundException, CompilationFailedException {
    Container room;
    logger.info("moving player to location.");
    ObjectLocation location = player.getContainerLocation();

    room = (Container) getObjectRegistry().getMudObject(location.getBeanId());
    if (room == null) {
      logger.info("loading container");
      room = (Container) load(location);
    }
    if (room == null) {
View Full Code Here


  }

  public void moveToLocation(MudObject player) throws InstantiationException, FileNotFoundException, CompilationFailedException, MudCloneException {
    Container room = null;
    logger.info("moving player to location.");
    ObjectLocation location = player.getContainerLocation();
    room = (Container) getObjectRegistry().getMudObject(location.getHandle());
    if (room == null) {
      logger.info("loading container..");
      load(location);
      room = (Container) cloneObject(location.getHandle());
    }

    if (room == null) {
      throw new InstantiationException("container was null!");
    }
View Full Code Here

              return reg;
            }

    };

    ObjectLocation location = new ObjectLocation();
    location.setDefinition(scriptName);
    location.setBeanId("beanId");
    MudObject myObj = attnd.load(location);

    assertEquals(mudObject.getClass(), myObj.getClass());
    ctxCtrl.verify();
    regCtrl.verify();
View Full Code Here

              return reg;
            }

    };

    ObjectLocation location = new ObjectLocation();
    location.setDefinition(scriptName);
    location.setBeanId("beanId");
    MudObject myObj = attnd.load(location);

    assertEquals(mudObject.getClass(), myObj.getClass());
    ctxCtrl.verify();
    regCtrl.verify();
View Full Code Here

        return inputStream;
      }

      @Override
      public ObjectLocation getPlayerImpl() {
        ObjectLocation loc = new ObjectLocation();
        loc.setBeanId("player.impl");
        loc.setDefinition("loc/def");
        return loc;
      }

      @Override
      protected File createFile(String username) {
View Full Code Here

    return new File(mudSpacePlayerLocation + username + ".xml");
  }

  public void movePlayerToLocation(Player player) throws InstantiationException, FileNotFoundException, CompilationFailedException {
    Container room;
    ObjectLocation location = player.getContainerLocation();

    room = (Container) getObjectRegistry().getMudObject(location.getBeanId());
    if (room == null) {
      room = (Container) load(location);
    }
    if (room == null) {
      throw new InstantiationException("room was null!");
View Full Code Here

        return inv;
      }

    };
    mockRoom.getContainerLocation();
    ObjectLocation loc = new ObjectLocation();
    loc.setDefinition("tomb/tomb1.groovy");
    loc.setBeanId("id");
    mockCtrl.setDefaultReturnValue(loc);
    mockRoom.setCurrentContainer(reg);
    mockCtrl.setDefaultVoidCallable();
    mockCtrl.replay();
    inv.addMudObject("id", mockRoom);
    invCtrl.setDefaultVoidCallable();
    invCtrl.replay();

    obs.addObserver(reg);
    obsCtrl.setDefaultVoidCallable();
    obsCtrl.replay();

    reg.addMudObject(loc.getBeanId(), mockRoom);

    mockCtrl.verify();
    invCtrl.verify();
    obsCtrl.verify();
  }
View Full Code Here

TOP

Related Classes of org.groovymud.object.ObjectLocation

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.