summaryrefslogtreecommitdiff
path: root/src/game/Tool.h
diff options
context:
space:
mode:
authorSimon Robertshaw <simon@hardwired.org.uk>2012-01-22 23:24:49 (GMT)
committer Simon Robertshaw <simon@hardwired.org.uk>2012-01-22 23:24:49 (GMT)
commit8c0678fa48f9598a5ade2d4960c46bfea7e6abef (patch)
tree880535e7984c24948d345932f680ef806baa4cec /src/game/Tool.h
parent19c1fa5dcb4c4a2ba9d692e136b17da316a2631b (diff)
downloadpowder-8c0678fa48f9598a5ade2d4960c46bfea7e6abef.zip
powder-8c0678fa48f9598a5ade2d4960c46bfea7e6abef.tar.gz
Begining menu, tool
Diffstat (limited to 'src/game/Tool.h')
-rw-r--r--src/game/Tool.h53
1 files changed, 53 insertions, 0 deletions
diff --git a/src/game/Tool.h b/src/game/Tool.h
new file mode 100644
index 0000000..842f4a2
--- /dev/null
+++ b/src/game/Tool.h
@@ -0,0 +1,53 @@
+/*
+ * Tool.h
+ *
+ * Created on: Jan 22, 2012
+ * Author: Simon
+ */
+
+#ifndef TOOL_H_
+#define TOOL_H_
+
+#include <iostream>
+
+using namespace std;
+
+class Tool
+{
+protected:
+ int toolID, colRed, colBlue, colGreen;
+ string toolName;
+public:
+ Tool(int id, string name, int r, int b, int g):
+ toolID(id),
+ toolName(name),
+ colRed(r),
+ colGreen(g),
+ colBlue(b)
+ {
+ }
+ virtual ~Tool() {}
+ virtual void Draw(Simulation * sim, Brush * brush, ui::Point position) {}
+ virtual void DrawLine(Simulation * sim, Brush * brush, ui::Point position1, ui::Point position2) {}
+ virtual void DrawRect(Simulation * sim, Brush * brush, ui::Point position1, ui::Point position2) {}
+};
+
+class ElementTool: public Tool
+{
+public:
+ ElementTool(int id, string name, int r, int b, int g):
+ Tool(id, name, r, g, b)
+ {
+ }
+ virtual ~ElementTool() {}
+ virtual void Draw(Simulation * sim, Brush * brush, ui::Point position){
+ sim->create_parts(position.X, position.Y, 1, 1, toolID, 0, brush);
+ }
+ virtual void DrawLine(Simulation * sim, Brush * brush, ui::Point position1, ui::Point position2) {
+ std::cout << position1.X << toolID << brush << std::endl;
+ sim->create_line(position1.X, position1.Y, position2.X, position2.Y, 1, 1, toolID, 0, brush);
+ }
+ virtual void DrawRect(Simulation * sim, Brush * brush, ui::Point position1, ui::Point position2) {}
+};
+
+#endif /* TOOL_H_ */