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:
parent
9bf7a9d8ec
commit
a92a5d6107
3 changed files with 25 additions and 0 deletions
|
@ -10,6 +10,9 @@ package micropolisj.engine;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Contains the code for performing a city evaluation.
|
||||||
|
*/
|
||||||
public class CityEval
|
public class CityEval
|
||||||
{
|
{
|
||||||
private final Micropolis engine;
|
private final Micropolis engine;
|
||||||
|
@ -56,6 +59,9 @@ public class CityEval
|
||||||
/** Score for various problems. */
|
/** Score for various problems. */
|
||||||
public EnumMap<CityProblem,Integer> problemTable = new EnumMap<>(CityProblem.class);
|
public EnumMap<CityProblem,Integer> problemTable = new EnumMap<>(CityProblem.class);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Perform an evaluation.
|
||||||
|
*/
|
||||||
void cityEvaluation()
|
void cityEvaluation()
|
||||||
{
|
{
|
||||||
if (engine.totalPop != 0) {
|
if (engine.totalPop != 0) {
|
||||||
|
|
|
@ -8,11 +8,24 @@
|
||||||
|
|
||||||
package micropolisj.engine;
|
package micropolisj.engine;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Coordinates of a location (x,y) in the city.
|
||||||
|
*/
|
||||||
public class CityLocation
|
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;
|
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;
|
public int y;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructs and initializes city coordinates.
|
||||||
|
*/
|
||||||
public CityLocation(int x, int y)
|
public CityLocation(int x, int y)
|
||||||
{
|
{
|
||||||
this.x = x;
|
this.x = x;
|
||||||
|
|
|
@ -12,6 +12,9 @@ import java.util.*;
|
||||||
|
|
||||||
import static micropolisj.engine.TileConstants.*;
|
import static micropolisj.engine.TileConstants.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Contains the code for generating a random map terrain.
|
||||||
|
*/
|
||||||
public class MapGenerator
|
public class MapGenerator
|
||||||
{
|
{
|
||||||
Micropolis engine;
|
Micropolis engine;
|
||||||
|
@ -46,6 +49,9 @@ public class MapGenerator
|
||||||
return map.length;
|
return map.length;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Generate a random map terrain.
|
||||||
|
*/
|
||||||
public void generateNewCity()
|
public void generateNewCity()
|
||||||
{
|
{
|
||||||
long r = Micropolis.DEFAULT_PRNG.nextLong();
|
long r = Micropolis.DEFAULT_PRNG.nextLong();
|
||||||
|
|
Reference in a new issue