docs: add inline documentation for various Sprite classes
git-svn-id: https://micropolis.googlecode.com/svn/trunk/micropolis-java@918 d9718cc8-9f43-0410-858b-315f434eb58c
This commit is contained in:
parent
8b0c6df05c
commit
a8710741d9
8 changed files with 42 additions and 0 deletions
|
@ -8,6 +8,12 @@
|
|||
|
||||
package micropolisj.engine;
|
||||
|
||||
/**
|
||||
* Implements the airplane.
|
||||
* The airplane appears if the city contains an airport.
|
||||
* It first takes off, then flies around randomly,
|
||||
* occassionally crashing.
|
||||
*/
|
||||
public class AirplaneSprite extends Sprite
|
||||
{
|
||||
int destX;
|
||||
|
|
|
@ -10,6 +10,11 @@ package micropolisj.engine;
|
|||
|
||||
import static micropolisj.engine.TileConstants.*;
|
||||
|
||||
/**
|
||||
* Implements an explosion.
|
||||
* An explosion occurs when certain sprites collide,
|
||||
* or when a zone is demolished by fire.
|
||||
*/
|
||||
public class ExplosionSprite extends Sprite
|
||||
{
|
||||
public ExplosionSprite(Micropolis engine, int x, int y)
|
||||
|
|
|
@ -8,6 +8,12 @@
|
|||
|
||||
package micropolisj.engine;
|
||||
|
||||
/**
|
||||
* Implements the helicopter.
|
||||
* The helicopter appears if the city contains an airport.
|
||||
* It usually flies to the location in the city with the highest
|
||||
* traffic density, but sometimes flies to other locations.
|
||||
*/
|
||||
public class HelicopterSprite extends Sprite
|
||||
{
|
||||
int count;
|
||||
|
|
|
@ -10,6 +10,9 @@ package micropolisj.engine;
|
|||
|
||||
import static micropolisj.engine.TileConstants.*;
|
||||
|
||||
/**
|
||||
* Implements a monster (one of the Micropolis disasters).
|
||||
*/
|
||||
public class MonsterSprite extends Sprite
|
||||
{
|
||||
int count;
|
||||
|
|
|
@ -10,6 +10,12 @@ package micropolisj.engine;
|
|||
|
||||
import static micropolisj.engine.TileConstants.*;
|
||||
|
||||
/**
|
||||
* Implements the cargo ship.
|
||||
* The cargo ship is created if the city contains a sea port.
|
||||
* It follows the river "channel" that was originally generated.
|
||||
* It frequently turns around.
|
||||
*/
|
||||
public class ShipSprite extends Sprite
|
||||
{
|
||||
static int [] BDx = { 0, 0, 1, 1, 1, 0, -1, -1, -1 };
|
||||
|
|
|
@ -10,6 +10,13 @@ package micropolisj.engine;
|
|||
|
||||
import static micropolisj.engine.TileConstants.*;
|
||||
|
||||
/**
|
||||
* Represents a mobile entity on the city map, such as a tornado
|
||||
* or a train. There can be any number present in a city, and each one
|
||||
* gets a chance to act on every tick of the simulation.
|
||||
*
|
||||
* @see Micropolis#moveObjects
|
||||
*/
|
||||
public abstract class Sprite
|
||||
{
|
||||
Micropolis city;
|
||||
|
|
|
@ -8,6 +8,9 @@
|
|||
|
||||
package micropolisj.engine;
|
||||
|
||||
/**
|
||||
* Implements a tornado (one of the Micropolis disasters).
|
||||
*/
|
||||
public class TornadoSprite extends Sprite
|
||||
{
|
||||
static int [] CDx = { 2, 3, 2, 0, -2, -3 };
|
||||
|
|
|
@ -10,6 +10,12 @@ package micropolisj.engine;
|
|||
|
||||
import static micropolisj.engine.TileConstants.*;
|
||||
|
||||
/**
|
||||
* Implements the commuter train.
|
||||
* The commuter train appears if the city has a certain amount of
|
||||
* railroad track. It wanders around the city's available track
|
||||
* randomly.
|
||||
*/
|
||||
public class TrainSprite extends Sprite
|
||||
{
|
||||
static int [] Cx = { 0, 16, 0, -16 };
|
||||
|
|
Reference in a new issue