Tileset validation stuff.

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@701 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Michael Bayne
2001-11-29 21:58:49 +00:00
parent 46b71392aa
commit fbc7d15066
2 changed files with 28 additions and 2 deletions
@@ -1,5 +1,5 @@
//
// $Id: BaseTileSet.java,v 1.8 2001/11/29 00:17:32 mdb Exp $
// $Id: BaseTileSet.java,v 1.9 2001/11/29 21:58:49 mdb Exp $
package com.threerings.miso.tile;
@@ -27,6 +27,14 @@ public class BaseTileSet extends SwissArmyTileSet
_passable = passable;
}
/**
* Returns the passability information for the tiles in this tileset.
*/
public boolean[] getPassability ()
{
return _passable;
}
// documentation inherited
protected Tile createTile (int tileIndex, Image image)
{
@@ -1,5 +1,5 @@
//
// $Id: BaseTileSetRuleSet.java,v 1.6 2001/11/29 00:18:33 mdb Exp $
// $Id: BaseTileSetRuleSet.java,v 1.7 2001/11/29 21:58:49 mdb Exp $
package com.threerings.miso.tools.tile.xml;
@@ -11,6 +11,8 @@ import com.samskivert.xml.CallMethodSpecialRule;
import com.threerings.media.tile.TileSet;
import com.threerings.media.tools.tile.xml.SwissArmyTileSetRuleSet;
import com.threerings.miso.Log;
import com.threerings.miso.tile.BaseTileSet;
/**
@@ -43,6 +45,22 @@ public class BaseTileSetRuleSet extends SwissArmyTileSetRuleSet
});
}
// documentation inherited
public boolean isValid (Object target)
{
BaseTileSet set = (BaseTileSet)target;
boolean valid = super.isValid(target);
// check for a <passable> element
if (set.getPassability() == null) {
Log.warning("Tile set definition missing valid <passable> " +
"element [set=" + set + "].");
valid = false;
}
return valid;
}
// documentation inherited
protected Class getTileSetClass ()
{