javadocs: document CityLocation, CityEval, and MapGenerator classes

git-svn-id: https://micropolis.googlecode.com/svn/trunk/micropolis-java@545 d9718cc8-9f43-0410-858b-315f434eb58c
This commit is contained in:
jason@long.name 2013-02-18 01:56:47 +00:00
parent 9bf7a9d8ec
commit a92a5d6107
3 changed files with 25 additions and 0 deletions

View file

@ -10,6 +10,9 @@ package micropolisj.engine;
import java.util.*;
/**
* Contains the code for performing a city evaluation.
*/
public class CityEval
{
private final Micropolis engine;
@ -56,6 +59,9 @@ public class CityEval
/** Score for various problems. */
public EnumMap<CityProblem,Integer> problemTable = new EnumMap<>(CityProblem.class);
/**
* Perform an evaluation.
*/
void cityEvaluation()
{
if (engine.totalPop != 0) {

View file

@ -8,11 +8,24 @@
package micropolisj.engine;
/**
* Coordinates of a location (x,y) in the city.
*/
public class CityLocation
{
/** The X coordinate of this location.
* Increasing X coordinates correspond to East,
* and decreasing X coordinates correspond to West. */
public int x;
/** The Y coordinate of this location.
* Increasing Y coordinates correspond to South,
* and decreasing Y coordinates correspond to North. */
public int y;
/**
* Constructs and initializes city coordinates.
*/
public CityLocation(int x, int y)
{
this.x = x;

View file

@ -12,6 +12,9 @@ import java.util.*;
import static micropolisj.engine.TileConstants.*;
/**
* Contains the code for generating a random map terrain.
*/
public class MapGenerator
{
Micropolis engine;
@ -46,6 +49,9 @@ public class MapGenerator
return map.length;
}
/**
* Generate a random map terrain.
*/
public void generateNewCity()
{
long r = Micropolis.DEFAULT_PRNG.nextLong();