Wartbed:Manual/Theatre of War

From Dark Omen Wiki

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


This article discusses
  • Theatre: The class encapsulating the entire set of constituent elements from which the game "map" or "level" is built and construed.
  • theatre::SceneElement: The base class for all contents in a scene (all Props in a Theatre).
  • theatre::Light: A class representing a non-effect light affecting the stage
  • theatre::Indicator: A class used as an ersatz or indicator of something not visible

Theatre and SceneElements

The Theatre class represents the world by containing all SceneElement Props constituting it. Unit movement and pathfinding does not primarily use the Theatre contents, but instead calls on a node-space representation of the map. This part of WARTBED intentionally uses the theatre metaphor because of its good fit and relevant separation of responsibilities.

Generic overview:

typedef shared_ptr<SceneElement *> SCENE_ELEMENT;
 
class Theatre
{
    SCENE_ELEMENT root;
    ...
};
 
namespace theatre
{
    class SceneElement : public Prop
    {
        ...
    };
 
    class ElementGroup : SceneElement
    {
        ...
    };
 
    class Light : SceneElement
    {
        ...
    };
 
    class Indicator : SceneElement
    {
        ...
    };
}

The Theatre contains specialisations of SceneElement stored in SCENE_ELEMENT smart pointers. All elements are nodes in a hierarchy, starting at Theatre::root.

All scene elements are Props, and all are created through an abstract factory. Thus, the Theatre class and subscribing code need not care about the underlying implementation of the scene components, which means that the same architecture can be used both for server and client modules.

Weather

Placeholder

Personal tools
communication