summaryrefslogtreecommitdiff
path: root/includes/Console.h
diff options
context:
space:
mode:
authorSimon Robertshaw <simon@hardwired.org.uk>2012-01-11 22:59:45 (GMT)
committer Simon Robertshaw <simon@hardwired.org.uk>2012-01-11 22:59:45 (GMT)
commitfc2f52099c0bbb2412046252bf7b5e4113bbe8e4 (patch)
treeaa820daf182a845758c3ba2c649df54a228748d4 /includes/Console.h
parent2eb09c1daac8199532694167f418146fa57e7735 (diff)
downloadpowder-fc2f52099c0bbb2412046252bf7b5e4113bbe8e4.zip
powder-fc2f52099c0bbb2412046252bf7b5e4113bbe8e4.tar.gz
More stuff, started console
Diffstat (limited to 'includes/Console.h')
-rw-r--r--includes/Console.h44
1 files changed, 44 insertions, 0 deletions
diff --git a/includes/Console.h b/includes/Console.h
new file mode 100644
index 0000000..806c4db
--- /dev/null
+++ b/includes/Console.h
@@ -0,0 +1,44 @@
+#ifndef CONSOLE_H
+#define CONSOLE_H
+
+#include <string>
+#include <vector>
+
+#include "interface/Sandbox.h"
+#include "Simulation.h"
+
+class ConsoleCommand
+{
+private:
+ std::string * command;
+ int returnStatus;
+ std::string * error;
+public:
+ void SetCommand(std::string * command);
+ void SetError(std::string * error);
+ std::string * GetCommand();
+ std::string * GetError();
+ ConsoleCommand();
+ ConsoleCommand(std::string * command, int returnStatus, std::string * error = new std::string(""));
+};
+
+class Console
+{
+private:
+ std::vector<ConsoleCommand> * previousCommands;
+ std::string * lastError;
+ ui::Sandbox * sandbox;
+ Simulation * sim;
+public:
+ virtual void Tick(float * dt);
+ int ParseType(std::string * type);
+ virtual void ConsoleShown();
+ virtual void ConsoleHidden();
+ virtual int ProcessCommand(std::string * command);
+ virtual std::string * GetLastError();
+ virtual std::vector<ConsoleCommand> * GetPreviousCommands();
+ Console(ui::Sandbox * sandbox);
+ virtual ~Console();
+};
+
+#endif // CONSOLE_H