00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef _LINEVISUAL_
00019 #define _LINEVISUAL_
00020
00021 #include <vector>
00022
00023 #include "game/BaseVisual.h"
00024 #include "game/VisualFactory.h"
00025
00026 #include "util/LineVertex.h"
00027
00028 class LineVisual : public BaseVisual
00029 {
00030 typedef std::vector<LineVertex> VertexList;
00031 private:
00032
00033 VertexList m_vertices;
00034
00035 public:
00036 DEFAULT_VISUAL_CONSTRUCTOR(LineVisual, );
00037
00038 void AddVertex(const LineVertex & vertex) { m_vertices.push_back(vertex); }
00039 void ClearVertices() { m_vertices.clear(); }
00040 const VertexList & GetVertices() const { return m_vertices; }
00041
00042 virtual void RenderVisual(AbstractRenderer * pRenderer, const int nDelta);
00043
00044 virtual bool FromAttribute(const Attribute * pRoot);
00045 virtual void ToStream(std::ostream& stream) const;
00046 virtual void FromStream(std::istream& stream);
00047 };
00048
00049 REGISTER_VISUAL(LineVisual, "visual_line");
00050
00051 #endif