Moved code to determine if the records are fully specified into
FringeConfiguration- the parser now just reports the error but doesn't know exactly what it did wrong. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1186 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// $Id: FringeConfiguration.java,v 1.4 2002/04/05 01:35:11 ray Exp $
|
||||
// $Id: FringeConfiguration.java,v 1.5 2002/04/05 01:45:53 ray Exp $
|
||||
|
||||
package com.threerings.miso.scene;
|
||||
|
||||
@@ -36,6 +36,12 @@ public class FringeConfiguration implements Serializable
|
||||
{
|
||||
tilesets.add(record);
|
||||
}
|
||||
|
||||
/** Did everything parse well? */
|
||||
public boolean isValid ()
|
||||
{
|
||||
return ((base_tsid != 0) && (priority > 0));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -48,6 +54,12 @@ public class FringeConfiguration implements Serializable
|
||||
|
||||
/** Is this a mask? */
|
||||
public boolean mask;
|
||||
|
||||
/** Did everything parse well? */
|
||||
public boolean isValid ()
|
||||
{
|
||||
return (fringe_tsid != 0);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// $Id: FringeConfigurationParser.java,v 1.3 2002/04/05 01:35:11 ray Exp $
|
||||
// $Id: FringeConfigurationParser.java,v 1.4 2002/04/05 01:45:53 ray Exp $
|
||||
|
||||
package com.threerings.miso.scene.tools.xml;
|
||||
|
||||
@@ -74,14 +74,13 @@ public class FringeConfigurationParser extends CompiledConfigParser
|
||||
new ValidatedSetNextRule(digest, "addFringeRecord",
|
||||
new ValidatedSetNextRule.Validator () {
|
||||
public boolean isValid (Object target) {
|
||||
FringeRecord frec = (FringeRecord) target;
|
||||
if ((frec.base_tsid == 0) ||
|
||||
(frec.priority <= 0)) {
|
||||
if (((FringeRecord) target).isValid()) {
|
||||
return true;
|
||||
} else {
|
||||
Log.warning("A FringeRecord was not added " +
|
||||
"because it was improperly specified.");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}) {
|
||||
|
||||
@@ -123,13 +122,13 @@ public class FringeConfigurationParser extends CompiledConfigParser
|
||||
digest.addRule(prefix, new ValidatedSetNextRule(digest, "addTileset",
|
||||
new ValidatedSetNextRule.Validator() {
|
||||
public boolean isValid (Object target) {
|
||||
FringeTileSetRecord ftsr = (FringeTileSetRecord) target;
|
||||
if (ftsr.fringe_tsid == 0) {
|
||||
if (((FringeTileSetRecord) target).isValid()) {
|
||||
return true;
|
||||
} else {
|
||||
Log.warning("A FringeTileSetRecord was not added " +
|
||||
"because it was improperly specified.");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}) {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user