Package org.groovymud.engine.event.system

Examples of org.groovymud.engine.event.system.MovementEvent


    leaves.setSourceMessage("Thanks for visiting!!");
    ((Observable) player).fireEvent(leaves);
  }

  protected synchronized void findNewContainer(ScopedEvent arg) {
    MovementEvent event = (MovementEvent) arg;
    Alive movingObject = event.getMovingObject();
    Container foundContainer = (Container) getMudObject(event.getRoomLocation().getBeanId());
    if (foundContainer == null) {
      Exception anException = null;
      try {
        foundContainer = (Container) getMudObjectAttendant().load(event.getRoomLocation());
      } catch (CompilationFailedException e) {
        logger.error(e, e);
        anException = e;
      } finally {
        if (anException != null) {
          try {
            movingObject.getTerminalOutput().writeln(anException.getMessage());
          } catch (IOException e) {
            logger.error(e, e);
          }
        }
      }
    }
    event.setFoundRoom(foundContainer);
  }
View Full Code Here


      logger.info("could not send leaving event");
    }
  }

  protected synchronized void findNewContainer(ScopedEvent arg) {
    MovementEvent event = (MovementEvent) arg;
    Alive movingObject = event.getMovingObject();
    Exception anException = null;
    Container foundContainer = null;
    try {
      foundContainer = castToContainer(getMudObjectAttendant().findOrClone(event.getRoomLocation()));
    } catch (MudCloneException e) {
      logger.error(e, e);
      anException = e;
    } finally {
      if (anException != null) {
        try {
          movingObject.getTerminalOutput().writeln(anException.getMessage());
        } catch (IOException e) {
          logger.error(e, e);
        }
      }
    }

    event.setFoundRoom(foundContainer);
  }
View Full Code Here

    leaves.setSourceMessage("Thanks for visiting!!");
    ((Observable) player).fireEvent(leaves);
  }

  protected synchronized void doMovementEvent(IScopedEvent arg) {
    MovementEvent event = (MovementEvent) arg;
    Alive movingObject = event.getMovingObject();
    Container foundRoom = (Container) getMudObject(event.getRoomLocation().getBeanId());
    if (foundRoom == null) {
      Exception anException = null;
      try {
        foundRoom = (Container) getMudObjectAttendant().load(event.getRoomLocation());
      } catch (CompilationFailedException e) {
        logger.error(e, e);
        anException = e;
      } finally {
        if (anException != null) {
          try {
            movingObject.getTerminalOutput().writeln(anException.getMessage());
          } catch (IOException e) {
            logger.error(e, e);
          }
        }
      }
    }
    event.setFoundRoom(foundRoom);
    // pass the event back to the room, with an altered scope
    event.setScope(EventScope.CONTAINER_SCOPE);
    ((Observable) event.getSourceExit()).doEvent(event);
  }
View Full Code Here

  boolean methodCalled;

  public void testDoUpdate() {
    final MessageEvent mE = new MessageEvent();
    final MovementEvent moveEvent = new MovementEvent(null, null, null, null);
    final DestroyEvent dE = new DestroyEvent();
    final SaveEvent sE = new SaveEvent();

    Registry reg = new Registry(null) {
View Full Code Here

TOP

Related Classes of org.groovymud.engine.event.system.MovementEvent

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.