# SpotSceneImpl (vilya 1.3 API)
Date: 2011-04-06

## com.threerings.whirled.spot.data
Class SpotSceneImpl

    java.lang.Object
      com.threerings.whirled.spot.data.SpotSceneImpl

All Implemented Interfaces:
  SpotScene

    public class SpotSceneImpl

extends Object
implements SpotScene

An implementation of the `SpotScene` interface.

Constructor Summary
`SpotSceneImpl()` Instantiates a blank scene implementation.
`SpotSceneImpl(SpotSceneModel smodel)` Creates an instance that will obtain data from the supplied spot scene model.

Method Summary
`void` `addPortal(Portal portal)` Adds a portal to this scene, immediately making the requisite modifications to the underlying scene model.
`Portal` `getDefaultEntrance()` Returns the portal that represents the default entrance to this scene.
`short` `getNextPortalId()` Returns the portal id that should be assigned to the next portal added to this scene.
`Portal` `getPortal(int portalId)` Returns a `Portal` object for the portal with the specified id or null if no portal exists with that id.
`int` `getPortalCount()` Returns the number of portals in this scene.
`Iterator<Portal>` `getPortals()` Returns an iterator over the portals in this scene.
`void` `removePortal(Portal portal)` Removes the specified portal from the scene.
`void` `setDefaultEntrance(Portal portal)` Sets the default entrance in this scene, immediately making the requisite modifications to the underlying scene model.
`void` `setDefaultEntranceId(int defaultEntranceId)` Used when we're being parsed from an XML scene model.
`void` `updateReceived()` This should be called if a scene update was received that caused our underlying scene model to change.

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### SpotSceneImpl

    public SpotSceneImpl(SpotSceneModel smodel)

  Creates an instance that will obtain data from the supplied spot scene model.

### SpotSceneImpl

    public SpotSceneImpl()

  Instantiates a blank scene implementation.

Method Detail

### getPortal

    public Portal getPortal(int portalId)

  Description copied from interface: `SpotScene`
  Returns a `Portal` object for the portal with the specified id or null if no portal exists with that id.

  Specified by:
    `getPortal` in interface `SpotScene`

### getPortalCount

    public int getPortalCount()

  Description copied from interface: `SpotScene`
  Returns the number of portals in this scene.

  Specified by:
    `getPortalCount` in interface `SpotScene`

### getPortals

    public Iterator<Portal> getPortals()

  Description copied from interface: `SpotScene`
  Returns an iterator over the portals in this scene.

  Specified by:
    `getPortals` in interface `SpotScene`

### getNextPortalId

    public short getNextPortalId()

  Description copied from interface: `SpotScene`
  Returns the portal id that should be assigned to the next portal added to this scene.

  Specified by:
    `getNextPortalId` in interface `SpotScene`

### getDefaultEntrance

    public Portal getDefaultEntrance()

  Description copied from interface: `SpotScene`
  Returns the portal that represents the default entrance to this scene. If a body enters the scene at logon time rather than entering from some other scene, this is the portal at which they would appear.

  Specified by:
    `getDefaultEntrance` in interface `SpotScene`

### addPortal

    public void addPortal(Portal portal)

  Description copied from interface: `SpotScene`
  Adds a portal to this scene, immediately making the requisite modifications to the underlying scene model. The portal id should have already been assigned using the value obtained from `SpotScene.getNextPortalId()`.

  Specified by:
    `addPortal` in interface `SpotScene`

### removePortal

    public void removePortal(Portal portal)

  Description copied from interface: `SpotScene`
  Removes the specified portal from the scene.

  Specified by:
    `removePortal` in interface `SpotScene`

### setDefaultEntranceId

    public void setDefaultEntranceId(int defaultEntranceId)

  Used when we're being parsed from an XML scene model.

### setDefaultEntrance

    public void setDefaultEntrance(Portal portal)

  Description copied from interface: `SpotScene`
  Sets the default entrance in this scene, immediately making the requisite modifications to the underlying scene model.

  Specified by:
    `setDefaultEntrance` in interface `SpotScene`

### updateReceived

    public void updateReceived()

  This should be called if a scene update was received that caused our underlying scene model to change.

Copyright © 2011. All Rights Reserved.