
#ifndef __WFX_SCENE_LISTSCENEGRAPH_H__
#define __WFX_SCENE_LISTSCENEGRAPH_H__

#include <WFX/WFXIncludes.h>
#include <WFX/scene/SceneGraph.h>
#include <WFX/scene/Node.h>

namespace WFX {

    namespace scene {

        /**
         * a simple list of AbstractNodes
         * not very efficient, but easy to implement ;)
         */
        class ListSceneGraph : public SceneGraph {
            public:
                ListSceneGraph() {}
                virtual ~ListSceneGraph();

                /** implement scenegraph interface */
                void update();
                void render(WFX::renderer::Renderer* r);

                /**
                 * adds the AbstractNode* to the List
                 * of nodes
                 */
                void add(AbstractNode* c) {
                    Nodes.push_back(c);
                }
                /** 
                 * removes the AbstractNode from the list - does not take responsibility
                 * of deleting the Node
                 * returns a pointer to the removed Node
                 */
                AbstractNode* remove(AbstractNode* v) {
                    Nodes.remove(v);
                    return v;
                }

                /** accept a SceneGraphVisitor */
                void accept(SceneGraphVisitor& v);
            protected:
                std::list<AbstractNode*> Nodes;

        };

    }

}


#endif //include guard


