This repository has been archived on 2025-03-20. You can view files and clone it, but cannot push or open issues or pull requests.
The-Powder-Toy/src/lua/CommandInterface.h
Tamás Bálint Misius 0179cefc78
Flatten include trees
2019-04-20 15:36:11 +02:00

37 lines
907 B
C++

#ifndef COMMANDINTERFACE_H_
#define COMMANDINTERFACE_H_
#include "common/String.h"
#include "lua/LuaEvents.h"
class Event;
class GameModel;
class GameController;
class Tool;
class CommandInterface
{
protected:
String lastError;
GameModel * m;
GameController * c;
public:
enum LogType { LogError, LogWarning, LogNotice };
enum FormatType { FormatInt, FormatString, FormatChar, FormatFloat, FormatElement };
CommandInterface(GameController * c, GameModel * m);
int GetPropertyOffset(ByteString key, FormatType & format);
void Log(LogType type, String message);
//void AttachGameModel(GameModel * m);
virtual void OnTick() { }
virtual bool HandleEvent(LuaEvents::EventTypes eventType, Event * event) { return true; }
virtual int Command(String command);
virtual String FormatCommand(String command);
String GetLastError();
virtual ~CommandInterface();
};
#endif /* COMMANDINTERFACE_H_ */