diff options
| author | Simon 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) |
| commit | fc2f52099c0bbb2412046252bf7b5e4113bbe8e4 (patch) | |
| tree | aa820daf182a845758c3ba2c649df54a228748d4 /includes | |
| parent | 2eb09c1daac8199532694167f418146fa57e7735 (diff) | |
| download | powder-fc2f52099c0bbb2412046252bf7b5e4113bbe8e4.zip powder-fc2f52099c0bbb2412046252bf7b5e4113bbe8e4.tar.gz | |
More stuff, started console
Diffstat (limited to 'includes')
| -rw-r--r-- | includes/Console.h | 44 | ||||
| -rw-r--r-- | includes/interface/Sandbox.h | 3 |
2 files changed, 47 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 diff --git a/includes/interface/Sandbox.h b/includes/interface/Sandbox.h index 10d588f..32a0471 100644 --- a/includes/interface/Sandbox.h +++ b/includes/interface/Sandbox.h @@ -16,11 +16,14 @@ namespace ui { class Sandbox: public ui::Component { private: + int lastCoordX, lastCoordY; + int activeElement; bool isMouseDown; Renderer * ren; Simulation * sim; public: Sandbox(); + virtual Simulation * GetSimulation(); virtual void OnMouseMovedInside(int localx, int localy, int dx, int dy); virtual void OnMouseDown(int localx, int localy, unsigned int button); virtual void OnMouseUp(int localx, int localy, unsigned int button); |
