net.sf.juoserver.controller
Class Intercom

java.lang.Object
  extended by net.sf.juoserver.controller.Intercom

public class Intercom
extends Object

This class acts as a mediatior between controllers, providing the means to coordinate them with each other thus implementing inter-client communication.

Controllers are notified of what's happening in the other controllers according to the observer pattern.


Constructor Summary
Intercom()
           
 
Method Summary
static void addIntercomListener(IntercomListener listener)
           
static void notifyChangedClothes(Mobile wearingMobile)
          Notifies that the specified mobile has changed their clothes.
static void notifyEnteredRange(Mobile enteredMobile, UOObject targetMobile)
          Notifies listeners that a mobile, enteredMobile, has entered another mobile's, targetMobile, range.
static void notifyItemDropped(Mobile droppingMobile, Item item, int targetSerialId, int targetX, int targetY, int targetZ)
          Notifies listeners about an item being dropped.
static void notifyMovement(Mobile movingMobile)
          Notifies listeners about a mobile's movement.
static void notifySpeech(Mobile speaker, MessageType type, int hue, int font, String language, String text)
          Notifies listeners about a mobile's speech.
static void removeIntercomListener(IntercomListener listener)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Intercom

public Intercom()
Method Detail

addIntercomListener

public static void addIntercomListener(IntercomListener listener)

removeIntercomListener

public static void removeIntercomListener(IntercomListener listener)

notifyMovement

public static void notifyMovement(Mobile movingMobile)
Notifies listeners about a mobile's movement.

Parameters:
movingMobile - the moving mobile
Throws:
IntercomException - in case of inter-client communication errors

notifyEnteredRange

public static void notifyEnteredRange(Mobile enteredMobile,
                                      UOObject targetMobile)
Notifies listeners that a mobile, enteredMobile, has entered another mobile's, targetMobile, range.

Parameters:
enteredMobile - the mobile who has entered the target's range
targetMobile - the mobile whose range is being entered
Throws:
IntercomException - in case of inter-client communication errors

notifySpeech

public static void notifySpeech(Mobile speaker,
                                MessageType type,
                                int hue,
                                int font,
                                String language,
                                String text)
Notifies listeners about a mobile's speech.

Parameters:
speaker - the speaking mobile
type - message type
hue - message colour
font - message font
language - message language
text - message text
Throws:
IntercomException - in case of inter-client communication errors

notifyItemDropped

public static void notifyItemDropped(Mobile droppingMobile,
                                     Item item,
                                     int targetSerialId,
                                     int targetX,
                                     int targetY,
                                     int targetZ)
Notifies listeners about an item being dropped.

Parameters:
droppingMobile - mobile dropping the item
item - item
targetSerialId - target serial ID
targetX - target X
targetY - target Y
targetZ - target Z

notifyChangedClothes

public static void notifyChangedClothes(Mobile wearingMobile)
Notifies that the specified mobile has changed their clothes.

Parameters:
wearingMobile - the mobile changing their clothes


Copyright © 2010-2012. All Rights Reserved.