oandxviewarch: Game example code

The oandxviewarch example is a GUI Crosses and Noughts game with multiple view switch.

The COandXApplication class forms a standard application class that tells the application framework about the application UID and creates the document object..

The COandXDocument class forms a standard document class that creates the application's UI, and stores and restores the game state.

The COandXAppUi class forms a standard application UI class that handles menu commands and reports information to the user.

The COandXGameView class draws the grid for playing Crosses and Noughts game. Depending upon the user selection it draws a cross and nought on the board. All the view drawing operations are taken care by this class.

The COandXController class is a controller class that uses instructions from the user to update the engine (board.)

The COandXEngine class is an engine class that represents the board, a grid of tiles which can be modified by the controller. This class contains the game logic and provides information on state of a tile as well as who won the game.

The COandXHistoryView class is a view class that displays the Noughts and Crosses game history or statistics. (The view simply displays the relevant control)


Click on the following link to download the example: oandxviewarch.zip

Click: browse to view the example code.

Class summary

CAknApplication, CAknViewAppUi, CAknView, CCoeControl, MCoeControlObserver, CAknDocument.


Commands are given to the example through its menu option.

Menu options are available to initiate the following activities:
  1. Selecting a new game.

  2. Choosing between crosses or noughts to move first.

  3. Obtaining game history.

  4. Resetting the game history.

  5. Showing the game again.

  6. Obtaining game statistics.