Package | Meaning |
---|---|
kero.util | Very useful, miscellaneous stuff (LGPL), |
kero.awt | Additions to the java.awt package
(LGPL),
|
jvpc.vga | Reads, maintains and writes all data (GPL), |
jvpc.jvpc | A (GUI) client for editing by hand (GPL), |
jvpc.vpcheck | A (text) client for checks and automatic editing (GPL). |
jvpc.vga
as a library, for
example, to make a client.
Game
In theory, there can be any amount of
Game
s run simultaneously, but the code restricts to using only one
for the moment.
Universe
Each game has a set of
Universe
s. For a ``turn'' there are two universes, one from the
RST file and one for the TRN file. Most important are those for the current
turn. The only editable universe is the TRN universe of the current turn.
MapSearch, Location
Within each universe there are
lists of planets and such. The structure MapSearch
supports
Location
s in the 2D map. On these locations consistency checks are
performed (comparing rst and trn information).
buildFactories()
. The package
methods trigger events like PlanetEvent
, to which you can
subscribe with methods like Universe.addPlanetListener()
.
Cargo
Noteworthy are the class
CargoTransfer
and the interface CargoTransferable
. In
combination with Cargo
, this is a surprisingly compact
implementation for cargo transfer of all types. CargoTransfer
has
a single function for all transfer, whereas
CargoTransferable
enables it for Ship
and
PData
only (and for ToShip
and ToPlanet
,
but these have an Assert.assert(false) inside).
Build
Simple interface to build structures.
PData
and BData
have an array struct[]
which contains all buildable objects.
Cargo
as well.
jvpc.vga
.
Input/OutputFileOpener
Try to read/write files in
lowercase and uppercase in two different directories, the work directory first,
the global directory last.
setFactories()
are used by the public methods like
buildFactories
. If you do not need an event to be thrown, set the
field by hand (struct
or cargo[].amount
).
*Gen.java
are descendants of Generator
.
Each generator is responsible for reading one file and putting the content in
the proper place in the data structure. E.g.
TruehullGen
reads from TRUEHULL.DAT
and initialises
all Truehull
objects in the game.
Frame
extends kero.awt.MyFrame
and
handles loads of awt events. The class JVPC
controls the set of
frames.
The MapFrame
implements the scrollbars itself (no
ScrollPane). The code is somewhat complex (read: somewhat bad). Besides,
scrollbars are lousily implemented in most JVMs (worse, constructor changed
subtly from Java 1.1 to 1.2).
VPCheck
), which run a
whole range of Checks and/or Actions. Each of these have a separate class. If
you make a new check or action, design a new Class and hook it in
VPCheckConfig
in the proper modes of the program.
I'd like you not to touch the jvpc.vga
package. Though it is GPL, it is dangerous to mess with Tims data
structures. If you find bugs or have suggestions for improvement, just report
them to me.