com.threerings.tudey.config
Class TileConfig.Original

java.lang.Object
  extended by com.threerings.util.DeepObject
      extended by com.threerings.tudey.config.TileConfig.Implementation
          extended by com.threerings.tudey.config.TileConfig.Original
All Implemented Interfaces:
Exportable, Copyable, Cloneable
Enclosing class:
TileConfig

public static class TileConfig.Original
extends TileConfig.Implementation

An original tile implementation.


Field Summary
 int[][] collisionFlags
          The tile's collision flags.
 boolean defaultEntrance
          Whether or not the tile should be used as a default entrance.
 int floorFlags
          The tile's floor flags.
 HandlerConfig[] handlers
          The tile's event handlers.
 int height
          The height of the tile.
 boolean mergeable
          Allows control over whether the tile can be merged with others.
 ConfigReference<ModelConfig> model
          The model to use for the tile.
 TagConfig tags
          Tags used to identify the tile within the scene.
 int width
          The width of the tile.
 
Constructor Summary
TileConfig.Original()
          Default constructor.
TileConfig.Original(String model)
          Creates an implementation with the specified model.
 
Method Summary
 int getCollisionFlags(int x, int y, int rotation, int tx, int ty)
          Returns the collision flags for the given location for a tile at the specified coordinates.
 TileCursor.Implementation getCursorImplementation(TudeyContext ctx, Scope scope, TileCursor.Implementation impl)
          Creates or updates a cursor implementation for this configuration.
 int getHeight(int rotation)
          Returns the height of the tile under the supplied rotation.
 String getLogicClassName()
          Returns the name of the server-side logic class to use for the tile, or null for none.
 TileConfig.Original getOriginal(ConfigManager cfgmgr)
          Returns a reference to the config's underlying original implementation.
 void getPreloads(ConfigManager cfgmgr, PreloadableSet preloads)
          Adds the resources to preload for this tile into the provided set.
 void getRegion(int x, int y, int rotation, Rectangle result)
          Finds the region covered by the tile at the specified coordinates.
 TileSprite.Implementation getSpriteImplementation(TudeyContext ctx, Scope scope, TileSprite.Implementation impl)
          Creates or updates a sprite implementation for this configuration.
 void getTransform(int x, int y, int elevation, int rotation, Transform3D result)
          Finds the transform of the tile at the specified coordinates.
 void getUpdateReferences(ConfigReferenceSet refs)
          Adds the implementation's update references to the provided set.
 int getWidth(int rotation)
          Returns the width of the tile under the supplied rotation.
 void invalidate()
          Invalidates any cached data.
 boolean isMergeable(ConfigManager cfgmgr)
          Checks whether we can merge this tile's model with others in the scene.
 
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

width

@Editable(min=1.0,
          hgroup="d")
public int width
The width of the tile.


height

@Editable(min=1.0,
          hgroup="d")
public int height
The height of the tile.


defaultEntrance

@Editable(hgroup="d")
@Strippable
public boolean defaultEntrance
Whether or not the tile should be used as a default entrance.


model

@Editable(nullable=true)
public ConfigReference<ModelConfig> model
The model to use for the tile.


collisionFlags

@Editable(width=3)
public int[][] collisionFlags
The tile's collision flags.


floorFlags

@Editable(editor="mask",
          mode="floor",
          hgroup="f")
public int floorFlags
The tile's floor flags.


mergeable

@Editable(hgroup="f")
public boolean mergeable
Allows control over whether the tile can be merged with others.


tags

@Editable
public TagConfig tags
Tags used to identify the tile within the scene.


handlers

@Editable
public HandlerConfig[] handlers
The tile's event handlers.

Constructor Detail

TileConfig.Original

public TileConfig.Original()
Default constructor.


TileConfig.Original

public TileConfig.Original(String model)
Creates an implementation with the specified model.

Method Detail

isMergeable

public boolean isMergeable(ConfigManager cfgmgr)
Checks whether we can merge this tile's model with others in the scene.


getTransform

public void getTransform(int x,
                         int y,
                         int elevation,
                         int rotation,
                         Transform3D result)
Finds the transform of the tile at the specified coordinates.


getRegion

public void getRegion(int x,
                      int y,
                      int rotation,
                      Rectangle result)
Finds the region covered by the tile at the specified coordinates.


getWidth

public int getWidth(int rotation)
Returns the width of the tile under the supplied rotation.


getHeight

public int getHeight(int rotation)
Returns the height of the tile under the supplied rotation.


getCollisionFlags

public int getCollisionFlags(int x,
                             int y,
                             int rotation,
                             int tx,
                             int ty)
Returns the collision flags for the given location for a tile at the specified coordinates.


getLogicClassName

public String getLogicClassName()
Returns the name of the server-side logic class to use for the tile, or null for none.


getPreloads

public void getPreloads(ConfigManager cfgmgr,
                        PreloadableSet preloads)
Adds the resources to preload for this tile into the provided set.


getUpdateReferences

public void getUpdateReferences(ConfigReferenceSet refs)
Description copied from class: TileConfig.Implementation
Adds the implementation's update references to the provided set.

Overrides:
getUpdateReferences in class TileConfig.Implementation

getOriginal

public TileConfig.Original getOriginal(ConfigManager cfgmgr)
Description copied from class: TileConfig.Implementation
Returns a reference to the config's underlying original implementation.

Specified by:
getOriginal in class TileConfig.Implementation

getCursorImplementation

public TileCursor.Implementation getCursorImplementation(TudeyContext ctx,
                                                         Scope scope,
                                                         TileCursor.Implementation impl)
Description copied from class: TileConfig.Implementation
Creates or updates a cursor implementation for this configuration.

Specified by:
getCursorImplementation in class TileConfig.Implementation
scope - the tile's expression scope.
impl - an existing implementation to reuse, if possible.
Returns:
either a reference to the existing implementation (if reused), a new implementation, or null if no implementation could be created.

getSpriteImplementation

public TileSprite.Implementation getSpriteImplementation(TudeyContext ctx,
                                                         Scope scope,
                                                         TileSprite.Implementation impl)
Description copied from class: TileConfig.Implementation
Creates or updates a sprite implementation for this configuration.

Specified by:
getSpriteImplementation in class TileConfig.Implementation
scope - the tile's expression scope.
impl - an existing implementation to reuse, if possible.
Returns:
either a reference to the existing implementation (if reused), a new implementation, or null if no implementation could be created.

invalidate

public void invalidate()
Description copied from class: TileConfig.Implementation
Invalidates any cached data.

Overrides:
invalidate in class TileConfig.Implementation


Copyright © 2011. All Rights Reserved.