docs: document the Tiles class

git-svn-id: https://micropolis.googlecode.com/svn/trunk/micropolis-java@919 d9718cc8-9f43-0410-858b-315f434eb58c
This commit is contained in:
jason@long.name 2014-03-05 01:58:31 +00:00
parent a8710741d9
commit bde6014165

View file

@ -12,6 +12,9 @@ import java.io.*;
import java.nio.charset.Charset; import java.nio.charset.Charset;
import java.util.*; import java.util.*;
/**
* Provides global methods for loading tile specifications.
*/
public class Tiles public class Tiles
{ {
static final Charset UTF8 = Charset.forName("UTF-8"); static final Charset UTF8 = Charset.forName("UTF-8");
@ -76,6 +79,12 @@ public class Tiles
} }
} }
/**
* Access a tile specification by index number.
*
* @return a tile specification, or null if there is no tile
* with the given number
*/
public static TileSpec get(int tileNumber) public static TileSpec get(int tileNumber)
{ {
if (tileNumber >= 0 && tileNumber < tiles.length) { if (tileNumber >= 0 && tileNumber < tiles.length) {