summaryrefslogtreecommitdiff
path: root/src/cat/CommandInterface.h
blob: 2e1a1dfaef43570519b91552638a5490ac0784f9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#ifndef COMMANDINTERFACE_H_
#define COMMANDINTERFACE_H_

#include <string>
#include "gui/interface/Engine.h"
//#include "game/GameModel.h"

class GameModel;
class GameController;
class Tool;
class CommandInterface {
protected:
	std::string lastError;
	GameModel * m;
	GameController * c;
public:
	enum LogType { LogError, LogWarning, LogNotice };
	enum FormatType { FormatInt, FormatString, FormatChar, FormatFloat };
	CommandInterface(GameController * c, GameModel * m);
	int GetPropertyOffset(std::string key_, FormatType & format);
	int GetParticleType(std::string type);
	void Log(LogType type, std::string message);
	//void AttachGameModel(GameModel * m);
	virtual bool OnBrushChanged(int brushType, int rx, int ry) {return true;}
	virtual bool OnActiveToolChanged(int toolSelection, Tool * tool) {return true;}
	virtual bool OnMouseMove(int x, int y, int dx, int dy) {return true;}
	virtual bool OnMouseDown(int x, int y, unsigned button) {return true;}
	virtual bool OnMouseUp(int x, int y, unsigned button) {return true;}
	virtual bool OnMouseWheel(int x, int y, int d) {return true;}
	virtual bool OnKeyPress(int key, Uint16 character, bool shift, bool ctrl, bool alt) {return true;}
	virtual bool OnKeyRelease(int key, Uint16 character, bool shift, bool ctrl, bool alt) {return true;}
	virtual void OnTick() {}
	virtual int Command(std::string command);
	virtual std::string FormatCommand(std::string command);
	std::string GetLastError();
	virtual ~CommandInterface();
};

#endif /* COMMANDINTERFACE_H_ */