Cities3D

Cities3D is a cross-platform implementation of the board game Settlers of Catan with all expansions, including Seafarers, and Cities & Knights.  It displays the game world in 3 dimensions, with rotation, panning, and zooming, in bright beautiful textures contributed to the project freely by talented individuals from around the world.  The user interface is entirely custom drawn, with crisp, clean lines and dozens of high-quality bitmaps to facilitate an intuitive, pleasing experience for users.  Cities3D has an extensible plugin architecture that allows new rules and variants to be added into the game without changing an ounce of code in existing rules or variants.  In fact, the core rules themselves for Settlers, and the expansions, are all plugins.

Cities3D is built on the firm foundation of OpenGL (http://www.opengl.org), wxWidgets (http://www.wxWidgets.org) and boost (http://www.boost.org), all real-world solutions that have been used in production code.  The architecture was built with a lot of thought, and a lot of Design Patterns, in an attempt to make a truly exceptional object-oriented system.  The sound library is fmod (http://www.fmod.org), and the unit testing is done with cppunit (http://cppunit.sourceforge.net/cgi-bin/moin.cgi).  The documentation you are reading was created using NaturalDocs (http://www.naturaldocs.org).

The Cities3D module is the capstone module that brings everything together.  As a result, it is a disparate collection of classes.  Some for the application framework, some for the custom controls, some for the many dialog windows, some for drag and drop functionality, and some for the totally custom-drawn UI pieces.  When it comes down to it, the Cities3D module is nothing more than the pretty front end for all of the work happening in other modules.  Cities3D is the View for the other modules Model.  Through an implementation of the Observer pattern, Cities3D keeps watch on all of the data and updates itself when notified that the data has changed.  It also provides mechanisms for the user to signal for certain actions to take place, which uses the Command pattern to execute the user’s request.  Each of the modules that Cities3D is built upon has been cleanly and logically separated from the others to maintain good stratification and encapsulation.  These other modules are:

DatabaseCoreProvides mundane, but important game management tasks.
GLCoreProvides a set of OpenGL windows and helper classes.
ModelCoreProvides all data classes, with helper classes and functions.
RulesCoreProvides the game play execution engine.
UICoreProvides the building blocks for a consistent UI look and feel.

It all starts with the wxCities3DApp class, the main application class built on the wxWidgets application infrastructure.  The wxCities3DApp class creates the wxMainFrame top-level frame window, which holds the SettlersView main game window.  Inside the main game window are all of the custom-drawn UI elements responsible for displaying the game information to the user.  These elements include BankUI, for showing the bank data, BuildUI, for showing available build options, ControlsUI, for showing what actions the user can take, MessageUI, for displaying text information to the user, PlayerUI, for showing the user what they have, and TurnUI, for showing the user the results of dice rolls.

There are many other classes in Cities3D, particularly the dialog windows, and the controls located within them (which includes all of the drag and drop functionality).  See the menus on the left for further information about any of them.

Classes

BankUI, BuildUI, ControlsUI, IPlayerDropTarget, MessageUI, PlayerUI, SettlersView, TurnUI, wxAddPlayerDialog, wxCities3DApp, wxGameListCtrl, wxGameSetupDialog, wxOpenGameDialog, wxMainFrame, wxMapListCtrl, wxMapTextCtrl, wxPlayerDataObject, wxPlayerDropListCtrl, wxPlayerDropTarget, wxPlayerListCtrl, wxPlayerTreeCtrl, wxSelectMapDialog, wxSettingsDialog, wxSplashDialog, wxOptionDisplaySize, wxOptionWindow

Depends On

DatabaseCore, GLCore, ModelCore, RulesCore, UICore

The main application class.
The top-level frame window.
The main game window.
Displays stacks of remaining bank cards.
Displays a possible action for the player.
Displays a set of buttons for user turn actions.
Displays game-related messages to the user.
Displays game information for one player.
Still volatile.
An interface for Player data drag and drop operations.
Dialog that allows users to add or edit players.
A list control displaying all games in the GameDatabase.
Dialog that sets up a hotseat game.
Dialog that allows users to open a saved game.
A list control displaying all maps in the MapDatabase.
Displays information about the currently selected map in a text control.
A data object for Player drag and drop operations.
Displays all of the players in the PlayerDatabase in a list control, with drag and drop initiation.
A drag and drop target for Player data objects.
Displays all of the players in the PlayerDatabase in a list control.
Displays all of the players in the current Game in a tree control, with full drag and drop support.
The wxOpenGameDialog constructor.
Still volatile.
Still volatile.
Still volatile.
Still volatile.
DatabaseCore provides a set of commonly used Singletons and namespaces that handle important, but mundane aspects of game management, such as available player colors, configuration options, image maniplulation, file paths, and playing sounds.
GLCore provides the underlying window classes and tools needed to create and use an OpenGL window with a camera, lighting, selection, mouse/keyboard handling, and IDrawObject rendering.
ModelCore provides all of the data classes and associated helper classes and functions required to represent a complete game.
RulesCore is the HOSS of Cities3D.
UICore provides a set of common UI controls that promote a constant look and feel across all aspects of the UI.