TileImage: refactor: s/readTileImage/readTileImageM
this method is called in the context of the parent tag; it reads all <image> tags that are children of the current tag and only returns one of them
This commit is contained in:
parent
030abc4512
commit
55f054a63e
2 changed files with 8 additions and 4 deletions
|
@ -109,7 +109,7 @@ public abstract class TileImage
|
|||
BufferedImage getImage(String name);
|
||||
}
|
||||
|
||||
public static SimpleTileImage readSimpleImage(XMLStreamReader in, LoaderContext ctx)
|
||||
static SimpleTileImage readSimpleImage(XMLStreamReader in, LoaderContext ctx)
|
||||
throws XMLStreamException
|
||||
{
|
||||
SimpleTileImage img = new SimpleTileImage();
|
||||
|
@ -142,7 +142,7 @@ public abstract class TileImage
|
|||
}
|
||||
}
|
||||
|
||||
public static AnimatedTile readAnimation(XMLStreamReader in, LoaderContext ctx)
|
||||
static AnimatedTile readAnimation(XMLStreamReader in, LoaderContext ctx)
|
||||
throws XMLStreamException
|
||||
{
|
||||
assert in.getLocalName().equals("animation");
|
||||
|
@ -162,7 +162,11 @@ public abstract class TileImage
|
|||
return anim;
|
||||
}
|
||||
|
||||
public static TileImage readTileImage(XMLStreamReader in, LoaderContext ctx)
|
||||
/**
|
||||
* @param in an XML stream reader with the parent tag of the tag to be read
|
||||
* still selected
|
||||
*/
|
||||
public static TileImage readTileImageM(XMLStreamReader in, LoaderContext ctx)
|
||||
throws XMLStreamException
|
||||
{
|
||||
TileImage img = null;
|
||||
|
|
|
@ -100,7 +100,7 @@ public class TileImages
|
|||
}
|
||||
|
||||
String tileName = in.getAttributeValue(null, "name");
|
||||
TileImage img = readTileImage(in, ctx);
|
||||
TileImage img = readTileImageM(in, ctx);
|
||||
|
||||
assert tileName != null;
|
||||
assert img != null;
|
||||
|
|
Reference in a new issue