|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Model leader: Kevin Rose
Original author: Kevin M. Rose
Revision history:
- 3/27/01 KMR Original first draft
- 4/12/01 KMR Added real class names, new classes from implementation
- 3/4/04 Modified for this website
- A map object represents the actual in-memory contents of a map, with its terrain, resources, and other features. The map object
consists of a large NxM array of map square structures. Each map square contains information about the contents of the square:
terrain type, features (rivers, roads, irrigation, etc), resources, shroud state, etc.
- This class is a general purpose, abstract class. It is used as a parent class by a game-specific subclass. It does not make assumptions
about the types of tiles that will be used, or how those tiles affect gameplay. It allows for tile information to be installed into
the class, which in turn drives the generic drawing and manipulation methods of this class. The purpose of this class is to hide
implementation details from the game-specific classes, such as the specific map object 'Col2MMapSpecific' (see below).
Specific Map Object ('Col2MMapSpecific'):
- A specific map object is a subclass of the Map Object class ('Col2MMap'). It provides game-specific details of a map, including
the defined terrain classes, features, and other special tile information. This class installs this game-specific information into
the general purpose Map Object class.
- Future versions of this class will be able to read this terrain and tile specific information from external sources, such as text
files, so that game-specific information is completely removed from this code base.
Map Window Object ('Col2MMapWin'):
- A map window object represents a display view of a given map. It references a Map Object, and a Graphics Window object, and contains
information about the map window display. This information includes the displayed world coordinates, associated Window object, and
any buffering outside of the surface backbuffering. This class contains general purpose drawing and map window manipulation methods.
Map Square Window Object ('Col2MsqMapWin'):
- A Map Square Window is a subclass of the Map Window class ('Col2MMapWin'). It represents a map with four-sided squares. It can be
used for both orthogonal squares (a grid) and isometric squares (similar to those used in Civilization II). This class contains
methods that draw and manipulate the Map Window in this 'square' format.
Game Editing Objects:
Map Generator Object ('Col2MmapGen'):
- The map generator object allows for the generation of a new map, given sufficient parameters for the map's size and other
characteristics. It generates a random map into a given map object.
Game Object ('TBD'):
- A Game object represents the entire current state of a given game. It contains a Map object, and the other objects necessary to model
the state of the game (Player sides, units, colonies, etc). Games can be saved to disk and restored into memory from disk.
Graphics Layer:
Surface Object ('Col2GrSurface'):
- A surface object is an in-memory representation of a graphics image. It consists of a width and height, information about the surface,
and a color palette (if applicable). Surfaces can be blitted (copied) onto other surfaces, as long as the surfaces have compatible
color widths (and palettes, if applicable). Surfaces also represent the 'viewable' portion of the screen, and any associated back
buffers.
- On the Windows platform, surface objects are used to represent DirectDraw surfaces. The Surface object hides platform-specific
implementation details of the underlying implementation in platform-specific code sections.
Bitmap Object ('Col2GrBmpfile'):
- A bitmap object is the in-memory representation of a bitmap file. It contains information about the bitmap, a surface that contains
the bitmap image, and the color palette, if applicable. Bitmaps can be read into memory from an existing saved bitmap file, and saved
back to bitmap files.
Tile Group Object ('Col2GrTileGroup'):
- A tile group ('Col2GrTileGroup') is an object that represents a number of individual tiles. A tile is a portion of a bitmap that
represents a particular image. A tile can be blitted (copied) directly onto a compatible Surface object. A tile group contains
information about the tile group, including the number and location of its tiles. It also contains a bitmap object, which holds the
actual tile images in the tile group. When saved, tile groups are represented by a textual tile group file and the associated bitmap
image file.
- Tile Groups are used to hold the graphic representation of terrain tiles, features (roads, etc), units, sprites, and other small
graphic objects. Tiles can also be used as frames of animation for any variety of objects.
Window Object ('Col2GrWin', 'Col2GrWinImp'):
- A Window object represents the window the game is running in. This object hides details about the platform-specific implementation
of windows, and allows for running in either full screen or windowed mode. The Window object is divided into a platform-independent
Window object class ('Col2GrWin'), and underlying platform-specific window classes. Current implementation contains only the
Windows-specific implementation class 'Col2GrWinImp'
Graphic Utilities Objects ('Col2GrPointI', 'Col2GrEdgeI', 'Col2GrIsoTile'):
- Various classes to help with geometry calculations: Point, Line, Edge, Isometric Tile classes.
Miscellaneous Classes :
String Object ('Col2UString'):
- String objects represent a localizable string. Actual character strings are not imbedded into the program; rather, constant
references to strings are indirected to language-specific translations. The string class allows strings to be accessed, formatted,
and printed in a language- and region-independent manner.
Memory Object ('Col2UMem'):
- Memory objects are used to track memory blocks allocated for various reasons. Instead of calling malloc or new, memory blocks are
created, resized, and freed through these memory objects. The advantage of memory objects is that memory can be validated and tracked
through this object layer. In addition, memory partitioning schemes can be used to create reusable pools of similarly sized objects,
thus reducing memory fragmentation, for example.
Error Object ('Col2Error'):
- Error objects represent an error or other information message. They are designed specifically to be 'thrown' by other classes. Errors
can then be deciphered for display or debugging purposes.
Value Object ('Col2UDVal'):
- Value objects represent a type-specific value in a single object. Value objects are typed (i.e. declared to have a certain type,
such as long integer or string) and share a common set of operators and manipulation routines. Methods can take Value Objects as
parameters, allowing for different types of data without different method specifications. In this sense, Value Objects are similar
to the VAR type in Visual Basic.
Key Table Object ('Col2Ukey'):
- A Key Table is a mechanism for creating a response mechanism to key strokes. Callers may install responses into the Key Table so that
their objects receive a 'message' when key strokes are performed in certain windows. Any number of 'keystroke listeners' can be
installed into a Key Table. The keystrokes can be normal keys, enhanced keys (platform-specific), and include shift/ctrl modifiers.
Message Receiver Objects ('Col2UmsgReceiver'):
- Message Receiver objects are usually used as a parent class for other classes. Inheriting from this Message Receiver class gives an object the ability to receive generic messages from other objects, in a fixed format method. It also allows objects to 'listen' for messages from other objects, by linking the objects. Object links can be uni- or bi-directional. Receivers can receive both messages (e.g. when some action performed on the linked object) and notifications (e.g. when an attribute of an object is changed).
|