com.threerings.tudey.data
Class TudeySceneModel.TileEntry

java.lang.Object
  extended by com.threerings.util.DeepObject
      extended by com.threerings.tudey.data.TudeySceneModel.Entry
          extended by com.threerings.tudey.data.TudeySceneModel.TileEntry
All Implemented Interfaces:
Exportable, Copyable, Cloneable
Enclosing class:
TudeySceneModel

public static class TudeySceneModel.TileEntry
extends TudeySceneModel.Entry

A tile entry. Tiles are identified by their locations.


Field Summary
 int elevation
          The tile's elevation.
 int rotation
          The tile's rotation.
 ConfigReference<TileConfig> tile
          The configuration of the tile.
 
Constructor Summary
TudeySceneModel.TileEntry()
           
 
Method Summary
 EntryCursor createCursor(TudeyContext ctx, TudeySceneView view)
          Creates a cursor for this entry (or returns null for none).
 Shape createShape(ConfigManager cfgmgr)
          Creates the shape for this entry, or returns null for none.
 EntrySprite createSprite(TudeyContext ctx, TudeySceneView view)
          Creates a sprite for this entry.
 int encode(int idx)
          Returns the encoded form of this tile entry.
 void getBounds(ConfigManager cfgmgr, Rect result)
          Finds the bounds of the entry.
 int getCollisionFlags(TileConfig.Original config, int x, int y)
          Returns the tile's collision flags at the specified coordinates.
 TileConfig.Original getConfig(ConfigManager cfgmgr)
          Resolves the tile's configuration.
 int getElevation()
          Returns the elevation of the entry, or Integer.MIN_VALUE for none.
 HandlerConfig[] getHandlers(ConfigManager cfgmgr)
          Returns the entry's handler configs, if any.
 int getHeight(TileConfig.Original config)
          Returns the height of this tile after rotation.
 Object getKey()
          Returns the key for this entry.
 Coord getLocation()
          Returns a reference to the tile's location.
 String getLogicClassName(ConfigManager cfgmgr)
          Returns the name of the server-side logic class to use for the entry, or null for none.
 ConfigReference<ModelConfig> getModel(ConfigManager cfgmgr)
          Returns a reference to the model associated with the entry, if any.
 void getPreloads(ConfigManager cfgmgr, PreloadableSet preloads)
          Adds the resources to preload for this entry to the supplied set.
 ConfigReference getReference()
          Returns a reference to this entry's config reference.
 void getRegion(TileConfig.Original config, Rectangle result)
          Populates the supplied rectangle with the region covered by this tile.
 float getRotation(ConfigManager cfgmgr)
          Returns the entry's approximate rotation.
 String[] getTags(ConfigManager cfgmgr)
          Returns the entry's tags, if any.
 void getTransform(TileConfig.Original config, Transform3D result)
          Populates the supplied transform with the transform of this tile.
 Vector2f getTranslation(ConfigManager cfgmgr)
          Returns the entry's approximate translation.
 int getWidth(TileConfig.Original config)
          Returns the width of this tile after rotation.
 boolean isDefaultEntrance(ConfigManager cfgmgr)
          Determines whether the entry represents a default entrance.
 boolean isValid(ConfigManager cfgmgr)
          Determines whether this entry has a valid configuration.
 void setReference(ConfigReference reference)
          Sets this entry's config reference.
 void transform(ConfigManager cfgmgr, Transform3D xform)
          Transforms the entry.
 
Methods inherited from class com.threerings.tudey.data.TudeySceneModel.Entry
createElement, createPatrolPath, getCollisionFlags
 
Methods inherited from class com.threerings.util.DeepObject
clone, copy, copy, equals, hashCode, toString
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

tile

@Editable(nullable=true)
public ConfigReference<TileConfig> tile
The configuration of the tile.


elevation

@Editable
public int elevation
The tile's elevation.


rotation

@Editable(min=0.0,
          max=3.0)
public int rotation
The tile's rotation.

Constructor Detail

TudeySceneModel.TileEntry

public TudeySceneModel.TileEntry()
Method Detail

getLocation

public Coord getLocation()
Returns a reference to the tile's location.


encode

public int encode(int idx)
Returns the encoded form of this tile entry.

Parameters:
idx - the tile config index.

getConfig

public TileConfig.Original getConfig(ConfigManager cfgmgr)
Resolves the tile's configuration.


getTransform

public void getTransform(TileConfig.Original config,
                         Transform3D result)
Populates the supplied transform with the transform of this tile.

Parameters:
config - the resolved configuration of the tile.

getRegion

public void getRegion(TileConfig.Original config,
                      Rectangle result)
Populates the supplied rectangle with the region covered by this tile.


getWidth

public int getWidth(TileConfig.Original config)
Returns the width of this tile after rotation.


getHeight

public int getHeight(TileConfig.Original config)
Returns the height of this tile after rotation.


getCollisionFlags

public int getCollisionFlags(TileConfig.Original config,
                             int x,
                             int y)
Returns the tile's collision flags at the specified coordinates.


getKey

public Object getKey()
Description copied from class: TudeySceneModel.Entry
Returns the key for this entry.

Specified by:
getKey in class TudeySceneModel.Entry

setReference

public void setReference(ConfigReference reference)
Description copied from class: TudeySceneModel.Entry
Sets this entry's config reference.

Specified by:
setReference in class TudeySceneModel.Entry

getReference

public ConfigReference getReference()
Description copied from class: TudeySceneModel.Entry
Returns a reference to this entry's config reference.

Specified by:
getReference in class TudeySceneModel.Entry

isValid

public boolean isValid(ConfigManager cfgmgr)
Description copied from class: TudeySceneModel.Entry
Determines whether this entry has a valid configuration.

Specified by:
isValid in class TudeySceneModel.Entry

getElevation

public int getElevation()
Description copied from class: TudeySceneModel.Entry
Returns the elevation of the entry, or Integer.MIN_VALUE for none.

Overrides:
getElevation in class TudeySceneModel.Entry

getBounds

public void getBounds(ConfigManager cfgmgr,
                      Rect result)
Description copied from class: TudeySceneModel.Entry
Finds the bounds of the entry.

Overrides:
getBounds in class TudeySceneModel.Entry

getLogicClassName

public String getLogicClassName(ConfigManager cfgmgr)
Description copied from class: TudeySceneModel.Entry
Returns the name of the server-side logic class to use for the entry, or null for none.

Specified by:
getLogicClassName in class TudeySceneModel.Entry

getTags

public String[] getTags(ConfigManager cfgmgr)
Description copied from class: TudeySceneModel.Entry
Returns the entry's tags, if any.

Specified by:
getTags in class TudeySceneModel.Entry

getHandlers

public HandlerConfig[] getHandlers(ConfigManager cfgmgr)
Description copied from class: TudeySceneModel.Entry
Returns the entry's handler configs, if any.

Specified by:
getHandlers in class TudeySceneModel.Entry

isDefaultEntrance

public boolean isDefaultEntrance(ConfigManager cfgmgr)
Description copied from class: TudeySceneModel.Entry
Determines whether the entry represents a default entrance.

Overrides:
isDefaultEntrance in class TudeySceneModel.Entry

getTranslation

public Vector2f getTranslation(ConfigManager cfgmgr)
Description copied from class: TudeySceneModel.Entry
Returns the entry's approximate translation.

Overrides:
getTranslation in class TudeySceneModel.Entry

getRotation

public float getRotation(ConfigManager cfgmgr)
Description copied from class: TudeySceneModel.Entry
Returns the entry's approximate rotation.

Overrides:
getRotation in class TudeySceneModel.Entry

getModel

public ConfigReference<ModelConfig> getModel(ConfigManager cfgmgr)
Description copied from class: TudeySceneModel.Entry
Returns a reference to the model associated with the entry, if any.

Overrides:
getModel in class TudeySceneModel.Entry

createShape

public Shape createShape(ConfigManager cfgmgr)
Description copied from class: TudeySceneModel.Entry
Creates the shape for this entry, or returns null for none.

Overrides:
createShape in class TudeySceneModel.Entry

transform

public void transform(ConfigManager cfgmgr,
                      Transform3D xform)
Description copied from class: TudeySceneModel.Entry
Transforms the entry.

Overrides:
transform in class TudeySceneModel.Entry

getPreloads

public void getPreloads(ConfigManager cfgmgr,
                        PreloadableSet preloads)
Description copied from class: TudeySceneModel.Entry
Adds the resources to preload for this entry to the supplied set.

Specified by:
getPreloads in class TudeySceneModel.Entry

createCursor

public EntryCursor createCursor(TudeyContext ctx,
                                TudeySceneView view)
Description copied from class: TudeySceneModel.Entry
Creates a cursor for this entry (or returns null for none).

Overrides:
createCursor in class TudeySceneModel.Entry

createSprite

public EntrySprite createSprite(TudeyContext ctx,
                                TudeySceneView view)
Description copied from class: TudeySceneModel.Entry
Creates a sprite for this entry.

Specified by:
createSprite in class TudeySceneModel.Entry


Copyright © 2011. All Rights Reserved.