summaryrefslogtreecommitdiff
path: root/tool.h
diff options
context:
space:
mode:
authorJon Bergli Heier <snakebite@jvnv.net>2011-04-18 19:35:48 +0200
committerJon Bergli Heier <snakebite@jvnv.net>2011-04-18 19:35:48 +0200
commit55e76bdaafa1e2a94fbd717335c1c7bd8c8fc156 (patch)
treecb9e0b4a9dd9f069098fead2f1b0fd0dd7311a62 /tool.h
parent0986cf8f33df8926dd8da67f98ed18f696141313 (diff)
Basic tool implementation.
Diffstat (limited to 'tool.h')
-rw-r--r--tool.h36
1 files changed, 36 insertions, 0 deletions
diff --git a/tool.h b/tool.h
new file mode 100644
index 0000000..13a833a
--- /dev/null
+++ b/tool.h
@@ -0,0 +1,36 @@
+#ifndef TOOL_H
+#define TOOL_H
+
+#include "quadtree.h"
+#include "vector.h"
+#include "gui.h"
+
+#include <SDL.h>
+
+class Tool {
+ protected:
+ Quadtree *tree;
+ GUI *gui;
+
+ public:
+ Tool(Quadtree *tree);
+ virtual ~Tool() {};
+
+ virtual bool handle_event(SDL_Event& event, Vector3& selected) = 0;
+ virtual void render_gui();
+ virtual const char* get_name() = 0;
+};
+
+class RaiseTool : public Tool {
+ protected:
+ static std::string name;
+
+ public:
+ RaiseTool(Quadtree *tree);
+ virtual ~RaiseTool();
+
+ virtual bool handle_event(SDL_Event& event, Vector3& selected);
+ virtual const char* get_name();
+};
+
+#endif