com.threerings.stage.server

## Class StageSceneManager

- java.lang.Object
- - com.threerings.crowd.server.PlaceManager
  - - com.threerings.whirled.server.SceneManager
    - - com.threerings.whirled.spot.server.SpotSceneManager
      - - com.threerings.stage.server.StageSceneManager

All Implemented Interfaces:
  com.threerings.crowd.chat.data.ChatCodes, com.threerings.crowd.chat.server.SpeakHandler.SpeakerValidator, com.threerings.crowd.data.LocationCodes, com.threerings.presents.data.InvocationCodes, com.threerings.presents.dobj.ChangeListener, com.threerings.presents.dobj.MessageListener, com.threerings.presents.server.InvocationProvider, StageSceneProvider, SceneCodes, SpotCodes

    public class StageSceneManager
    extends SpotSceneManager
    implements StageSceneProvider

Defines extensions to the basic Stage scene manager specific to displaying isometric "stage" scenes (these may be indoor, outdoor or aboard a vessel).

### Nested Class Summary

### Nested classes/interfaces inherited from class com.threerings.crowd.server.PlaceManager

`com.threerings.crowd.server.PlaceManager.DelegateOp, com.threerings.crowd.server.PlaceManager.MessageHandler`

### Field Summary

### Fields inherited from interface com.threerings.whirled.spot.data.SpotCodes

`CLUSTER_CHAT_TYPE, CLUSTER_FULL, INVALID_LOCATION, LOCATION_OCCUPIED, NO_SUCH_CLUSTER, NO_SUCH_PORTAL`

### Fields inherited from interface com.threerings.crowd.chat.data.ChatCodes

`BROADCAST_ACCESS, BROADCAST_MODE, CHAT_ACCESS, CHAT_CHANNEL_NOTIFICATION, CHAT_NOTIFICATION, DEFAULT_IDLE_TIME, DEFAULT_MODE, EMOTE_MODE, IDLE_TIME_KEY, LAST_MODE, PLACE_CHAT_TYPE, SHOUT_MODE, SUCCESS, THINK_MODE, USER_CHAT_TYPE, USER_DISCONNECTED, USER_NOT_ONLINE, XLATE_MODES`

### Fields inherited from interface com.threerings.whirled.data.SceneCodes

`SCENE_UPDATE, WHIRLED_GROUP`

### Fields inherited from interface com.threerings.crowd.data.LocationCodes

`ALREADY_THERE, MOVE_IN_PROGRESS, NO_SUCH_PLACE`

### Fields inherited from interface com.threerings.presents.data.InvocationCodes

`ACCESS_DENIED, E_ACCESS_DENIED, E_INTERNAL_ERROR, GLOBAL_GROUP, INTERNAL_ERROR`

### Constructor Summary

Constructors
Constructor and Description
`StageSceneManager()`

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `addObject(com.threerings.presents.data.ClientObject caller, com.threerings.miso.data.ObjectInfo info, com.threerings.presents.client.InvocationService.ConfirmListener listener)` Handles a `StageSceneService.addObject(com.threerings.miso.data.ObjectInfo, com.threerings.presents.client.InvocationService.ConfirmListener)` request.
`boolean` `addObject(com.threerings.miso.data.ObjectInfo info, boolean killOverlap, boolean allowOverlap)` Adds the supplied object to this scene.
`com.threerings.media.util.AStarPathUtil.TraversalPred` `getCanStandPred()` Returns a traversal predicate for use with `StageSceneUtil.findStandingSpot(java.awt.Rectangle, int, com.threerings.media.util.AStarPathUtil.TraversalPred, java.lang.Object, java.awt.Point, int)` that validates whether a player can stand in the searched spots.
`boolean` `isPassable(int tx, int ty)` Returns true if the specified tile coordinate is passable (the base tile is passable and it is not in the footprint of an object).
`boolean` `mayStandAtLocation(com.threerings.crowd.data.BodyObject source, StageLocation loc)` Called by NPPs to determine whether or not they can stand at the specified location.
`void` `removeObjects(com.threerings.presents.data.ClientObject caller, com.threerings.miso.data.ObjectInfo[] info, com.threerings.presents.client.InvocationService.ConfirmListener listener)` Handles a `StageSceneService.removeObjects(com.threerings.miso.data.ObjectInfo[], com.threerings.presents.client.InvocationService.ConfirmListener)` request.
`void` `setColor(int classId, int colorId)` Changes the default colorization for the specified color class.

### Methods inherited from class com.threerings.whirled.spot.server.SpotSceneManager

`clearEnteringBody, mapEnteringBody, mayTraversePortal, moveBodyToDefaultPortal, willTraversePortal`

### Methods inherited from class com.threerings.whirled.server.SceneManager

`getLocation, getScene, getUpdates, isPersistent, where`

### Methods inherited from class com.threerings.crowd.server.PlaceManager

`addDelegate, applyToDelegates, applyToOccupants, bodyWillEnter, bodyWillLeave, checkPermissions, getConfig, getPlaceObject, init, isValidSpeaker, messageReceived, ratifyBodyEntry, registerMessageHandler, shutdown, startup, toString, updateOccupantInfo`

### Methods inherited from class java.lang.Object

`equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Constructor Detail

#### StageSceneManager

    public StageSceneManager()

### Method Detail

#### getCanStandPred

    public com.threerings.media.util.AStarPathUtil.TraversalPred getCanStandPred()

Returns a traversal predicate for use with `StageSceneUtil.findStandingSpot(java.awt.Rectangle, int, com.threerings.media.util.AStarPathUtil.TraversalPred, java.lang.Object, java.awt.Point, int)` that validates whether a player can stand in the searched spots.

#### addObject

    public boolean addObject(com.threerings.miso.data.ObjectInfo info,
                             boolean killOverlap,
                             boolean allowOverlap)

Adds the supplied object to this scene. A persistent update is generated and broadcast to all scene occupants. The update is stored in the repository for communication to future occupants of the scene and then entire complex process of changing our virtual game world is effected at the simple call of this single method.

Parameters:
  `killOverlap` - if true, overlapping object will be removed, and the allowOverlap argument will be ignored.
  `allowOverlap` - if true, overlapping objects will be allowed but one must be *very* careful to ensure that they know what they are doing (i.e. the objects have render priorities that correctly handle the overlap).
Returns:
  true if the object was added, false if the add was rejected because the object overlaps an existing scene object.

#### setColor

    public void setColor(int classId,
                         int colorId)

Changes the default colorization for the specified color class. A persistent update is generated and broadcast to all scene occupants. The update is stored in the repository for communication to future occupants of the scene and then entire complex process of changing our virtual game world is effected at the simple call of this single method.

#### isPassable

    public boolean isPassable(int tx,
                              int ty)

Returns true if the specified tile coordinate is passable (the base tile is passable and it is not in the footprint of an object).

#### mayStandAtLocation

    public boolean mayStandAtLocation(com.threerings.crowd.data.BodyObject source,
                                      StageLocation loc)

Called by NPPs to determine whether or not they can stand at the specified location.

#### addObject

    public void addObject(com.threerings.presents.data.ClientObject caller,
                          com.threerings.miso.data.ObjectInfo info,
                          com.threerings.presents.client.InvocationService.ConfirmListener listener)
                   throws com.threerings.presents.server.InvocationException

Description copied from interface: `StageSceneProvider`
Handles a `StageSceneService.addObject(com.threerings.miso.data.ObjectInfo, com.threerings.presents.client.InvocationService.ConfirmListener)` request.

Specified by:
  `addObject` in interface `StageSceneProvider`
Throws:
  `com.threerings.presents.server.InvocationException`

#### removeObjects

    public void removeObjects(com.threerings.presents.data.ClientObject caller,
                              com.threerings.miso.data.ObjectInfo[] info,
                              com.threerings.presents.client.InvocationService.ConfirmListener listener)
                       throws com.threerings.presents.server.InvocationException

Description copied from interface: `StageSceneProvider`
Handles a `StageSceneService.removeObjects(com.threerings.miso.data.ObjectInfo[], com.threerings.presents.client.InvocationService.ConfirmListener)` request.

Specified by:
  `removeObjects` in interface `StageSceneProvider`
Throws:
  `com.threerings.presents.server.InvocationException`