Added the interface RecolorableTileSet which indicates that a TileSet

has colorizations and implements the "String[] getColorizations()" method.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3111 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Ray Greenwell
2004-08-30 22:09:29 +00:00
parent ae38a24d39
commit c314d304ec
3 changed files with 22 additions and 10 deletions
@@ -1,5 +1,5 @@
//
// $Id: ObjectTileSet.java,v 1.18 2004/08/27 02:12:41 mdb Exp $
// $Id: ObjectTileSet.java,v 1.19 2004/08/30 22:09:29 ray Exp $
//
// Narya library - tools for developing networked games
// Copyright (C) 2002-2004 Three Rings Design, Inc., All Rights Reserved
@@ -33,6 +33,7 @@ import com.threerings.media.image.Colorization;
* @see ObjectTile
*/
public class ObjectTileSet extends SwissArmyTileSet
implements RecolorableTileSet
{
/**
* Sets the widths (in unit tile count) of the objects in this
@@ -139,10 +140,7 @@ public class ObjectTileSet extends SwissArmyTileSet
return (_sorients == null) ? 0 : _sorients[tileIdx];
}
/**
* Returns the colorization classes that should be used to recolor
* objects in this tileset.
*/
// documentation inherited from interface RecolorableTileSet
public String[] getColorizations ()
{
return _zations;
@@ -0,0 +1,16 @@
//
// $Id: RecolorableTileSet.java,v 1.1 2004/08/30 22:09:29 ray Exp $
package com.threerings.media.tile;
/**
* Indicates that a tileset has recolorization classes defined.
*/
public interface RecolorableTileSet
{
/**
* Returns the colorization classes that should be used to recolor
* objects in this tileset.
*/
public String[] getColorizations ();
}
@@ -1,5 +1,5 @@
//
// $Id: TrimmedObjectTileSet.java,v 1.15 2004/08/27 02:12:41 mdb Exp $
// $Id: TrimmedObjectTileSet.java,v 1.16 2004/08/30 22:09:29 ray Exp $
//
// Narya library - tools for developing networked games
// Copyright (C) 2002-2004 Three Rings Design, Inc., All Rights Reserved
@@ -39,6 +39,7 @@ import com.threerings.media.tile.util.TileSetTrimmer;
* interchangeable (and more memory efficient).
*/
public class TrimmedObjectTileSet extends TileSet
implements RecolorableTileSet
{
// documentation inherited
public int getTileCount ()
@@ -74,10 +75,7 @@ public class TrimmedObjectTileSet extends TileSet
return (_bits == null) ? -1 : _bits[tileIdx].sorient;
}
/**
* Returns the colorization classes that should be used to recolor
* objects in this tileset.
*/
// documentation inherited from interface RecolorableTileSet
public String[] getColorizations ()
{
return _zations;