org.gjt.qcis.board
Downloads Source Javadoc
Author: Unspecified
Home Page:
Version: Unspecified
Release Tag: $
Release Date: 2000/04/11 01:15:36
JVM Required: 1.1
License: GNU Library General Public License
Categories: None
Requirements:
Dependencies: No dependencies
Externals: None

A framework for implementing 2D tiled board games. These have a 2D structure where each tile is the same shape, and "tiles" the 2D plain in the mathematical sense (fills it with no gaps). Squares, hexagons, and diamonds are tile shapes.

Design Issues

Major components, and their responsibilities are
GamePiece
An interface for game pieces and stacks of game pieces.
Tile
An interface for graphical information about a specific tile, such as what background should be displayed. It would change depending on the needs of TiledBoard.
TiledBoard
A JComponent subclass for displaying a tiled board. An initial implementation displays only square tiles; an advanced would use the Java 2D API to allow diamonds, hexagons, and so on.
TiledBoardModel
An interface to be implemented by classes that represent specific game boards. It provides a coordinate system and adjacency relationship for tiles, methods for iterating over tiles, and mapping between tiles and game pieces.

Several methods have signatures of the form

SomeType getSomething(SomeType x, ...)
To allow for flyweight implementations of SomeType, these methods have the option to create and return new objects only if parameter x is null; otherwise they can store their results in pre-existing x and return x. It should be possible, using these techniques, to implement gigantic virtual boards represented as an array of bytes, indexing into a small table of tile types. Objects would only be needed for playing pieces and whatever special features existed on certain tiles, plus the few tiles currently displayed.

To get some small type security with minimal overhead, coordinates are represented as a pair of short integers or as a single int encoding both, and directions are represented as a byte.


Downloads

The following page lists the available downloads for the release of package 'org.gjt.qcis.board' tagged ' $'. If you need to work with releases other than ' $', you will need to use the anonymous CVS server to access them.