Wartbed:Manual/Theatre of War

From Dark Omen Wiki

(Difference between revisions)
Jump to: navigation, search
(Updated to reflect actual implementation)
(Theatre and SceneElements)
Line 11: Line 11:
==Theatre and SceneElements==
==Theatre and SceneElements==
The Theatre class represents the world by containing all <tt>SceneElement Prop</tt>s constituting it. Unit movement and pathfinding does not primarily use the Theatre contents, but instead calls on a node-space representation of the map.  
The Theatre class represents the world by containing all <tt>SceneElement Prop</tt>s constituting it. Unit movement and pathfinding does not primarily use the Theatre contents, but instead calls on a node-space representation of the map.  
 +
 +
<tt>SceneElement</tt>s are all specialisations of <tt>Prop</tt>, which in turn is a specialisation of <tt>mvc::Model</tt>. Thus, all scene elements can be used transparently with all other models inside the MVC architecture. Scene elements are not <tt>Actor</tt>s, though, and can't be issued <tt>Order</tt>s.
 +
This part of WARTBED intentionally uses the theatre metaphor because of its good fit and relevant separation of responsibilities.  
This part of WARTBED intentionally uses the theatre metaphor because of its good fit and relevant separation of responsibilities.  
Line 48: Line 51:
The Theatre contains specialisations of SceneElement stored in SCENE_ELEMENT smart pointers. All elements are nodes in a hierarchy, starting at <tt>Theatre::root</tt>.
The Theatre contains specialisations of SceneElement stored in SCENE_ELEMENT smart pointers. All elements are nodes in a hierarchy, starting at <tt>Theatre::root</tt>.
-
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.  
+
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==
==Weather==

Revision as of 17:13, 27 February 2010


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.

SceneElements are all specialisations of Prop, which in turn is a specialisation of mvc::Model. Thus, all scene elements can be used transparently with all other models inside the MVC architecture. Scene elements are not Actors, though, and can't be issued Orders.

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