Package org.groovymud.object

Examples of org.groovymud.object.MudObject


      Container con = castToContainer(obj);
      con.getInventoryHandler().relinkContent(con);
    }

    if (obj.getId() != null) {
      MudObject old = getMudObject(obj.getId());
      if (old != null) {
        old.dest(false);
      }
    }
    if (isAliveInstance(obj)) {
      Alive alive = castToAlive(obj);
      if (alive.getTerminalOutput() == null) {
View Full Code Here


  }

  protected void notifyContents(IObservable observable, IScopedEvent event) {
    Iterator<MudObject> contentIterator = getMudObjects().iterator();
    while (contentIterator.hasNext()) {
      MudObject o = contentIterator.next();
      if (o instanceof Observer) {
        castToObserver(o).update(observable, event);
      }
    }
  }
View Full Code Here

  }

  protected void doDestroyEvent(IScopedEvent arg) {
    DestroyEvent ev = (DestroyEvent) arg;
    MudObject object = (MudObject) ev.getSource();
    if (object instanceof Player) {
      fireLeavingMessage((Player) object);
    }
    if (object instanceof Container) {
      unregisterContents(((Container) object));
    }
    removeMudObject(object);
    object.getCurrentContainer().removeMudObject(object);
    if (object instanceof Player) {
      try {
        ((Player) object).getTerminalOutput().close();
      } catch (IOException e) {
        logger.error(e, e);
View Full Code Here

  }

  public void addAllMudObjects(Set<MudObject> objects) {
    Iterator<MudObject> hashIterator = objects.iterator();
    while (hashIterator.hasNext()) {
      MudObject next = (MudObject) hashIterator.next();
      addMudObject(next);
    }
  }
View Full Code Here

      Iterator<Set<MudObject>> x = values.iterator();
      while (x.hasNext()) {
        Set<MudObject> next = x.next();
        Iterator<MudObject> hashIter = next.iterator();
        while (hashIter.hasNext()) {
          MudObject mo = hashIter.next();
          if (alive == (mo instanceof Alive)) {
            allObjects.add(mo);
          }
        }
      }
View Full Code Here

      while (moi.hasNext()) {
        Set<MudObject> set = getMudObjectHashSets().get(moi.next());
        if (set != null) {
          Iterator<MudObject> setI = set.iterator();
          while (setI.hasNext()) {
            MudObject x = setI.next();
            if (alive == (x instanceof Alive)) {
              addMudObjectToMap(x.getName(), x, objs);
            }
          }
        }
      }
    }
View Full Code Here

      argHolder.parse(nextCommand, player);

      Container container = player.getCurrentContainer();
      boolean commandRun = false;
      MudObject containerMO = (MudObject) container;
      if (containerMO != null) {
        // the object means to do the action with the container, it
        // holds a list of
        // local commands that need to be run.
        commandRun = containerMO.doCommand(player, argHolder.command, argHolder.args);
      }

      if (!commandRun) {
        // run through a privileged action so we don't access stuff we
        // shouldn't
View Full Code Here

  private ObjectLocation shutDownInformer;

  private static final Logger logger = Logger.getLogger(ShutdownBehaviour.class);

  protected void initialise() {
    MudObject informer = null;
    if (getInformer() == null) {
      try {
        informer = getAttendant().load(getShutDownInformer());

        setInformer(informer);
View Full Code Here

  public void testGetContentsDescription() {
    Set<MudObject> objects = new HashSet<MudObject>();
    objects.add(createMudObject());
    Set<MudObject> objects2 = new HashSet<MudObject>();
    MudObject two = createMudObject();
    objects.add(two);

    Map<String, Set<MudObject>> contents = new TreeMap<String, Set<MudObject>>();
    contents.put("something", objects);
    contents.put("somethingelse", objects2);
View Full Code Here

    Set<MudObject> objects = new HashSet<MudObject>();
    objects.add(createMudObject());
    objects.add(createMudObject());

    Set<MudObject> objects2 = new HashSet<MudObject>();
    MudObject two = createAliveObject();
    objects.add(two);
    Set<MudObject> objects3 = new HashSet<MudObject>();
    objects3.add(createMudObject());

    Map<String, Set<MudObject>> contents = new TreeMap<String, Set<MudObject>>();
View Full Code Here

TOP

Related Classes of org.groovymud.object.MudObject

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.