Wartbed:Manual/Conventions

From Dark Omen Wiki

< Wartbed:Manual
Revision as of 17:24, 27 February 2010 by Mikademus (Talk | contribs)
Jump to: navigation, search

Language

WARTBED uses British English, the one true and only English spelling, as do OGRE3D, which WARTBED relies on for graphics. Do keep to this convention!

Source files

With the exception of the main include file Wartbed.h, all WARTBED headers and source files are named in an identical fashion: the filenames are prefixed by "wb_" followed by the purpose or content with first character in upper case.

  • wb_Kernel.h
  • wb_Target.h

Specialised files are located in subfolders under the main WARTBED include folder and follow the same convention:

  • ogre_Utils.h (Utilities particular to WARTBED's OGRE3D implementation details)
  • do_PRJParser.h (Dark Omen data parser file)

Subscribing applications are free to use any naming convention but are advised to employ a similar scheme.

  • MyTacticsGame.h
  • mtt_Core.h
  • mtt_Player.h

Namespaces

Everything related to the WARTBED system itself is located under the wb namespace. In turn, every major component is represented by a class with its name, and a namespace under wb with the same name in lower case. The major class itself is always located outside the namespace of corresponding name.

namespace wb
{
    class Camera
    {
        ...
    };
 
    namespace camera
    {
        // support classes etc
    }
}

This naming convention is repeated throughout WARTBED: for instance in input/InputSystem, theatre/Theatre, gui/GUI etc.

Applications, games and modules using WARTBED generally are not placed under the wb namespace. For instance, the Dark Omen map viewer is located under its own darkomen namespace:

namespace darkomen
{
    using namespace wb;
 
    class MapViewer
    {
        ...
    };
}
Personal tools
communication