39 lines
918 B
C++
39 lines
918 B
C++
|
|
#ifndef TEXTGAME_HPP
|
|
#define TEXTGAME_HPP
|
|
|
|
#include "luaconsole.hpp"
|
|
#include "world.hpp"
|
|
#include "drivenengine.hpp"
|
|
#include <memory>
|
|
|
|
class TextGame : public DrivenEngine {
|
|
private:
|
|
using StringVec = LuaConsole::StringVec;
|
|
std::unique_ptr<World> world_;
|
|
LuaConsole console_;
|
|
Gui gui_;
|
|
int64_t gui_place_;
|
|
int64_t actor_id_;
|
|
|
|
void do_view_command(const StringVec &cmd);
|
|
void do_menu_command(const StringVec &cmd);
|
|
void do_choose_command(const StringVec &cmd);
|
|
void do_quit_command(const StringVec &cmd);
|
|
void do_snapshot_command(const StringVec &cmd);
|
|
void do_rollback_command(const StringVec &cmd);
|
|
void do_tick_command(const StringVec &cmd);
|
|
|
|
void do_lua(const std::string &exp);
|
|
void do_command(const StringVec &exp);
|
|
|
|
void check_redirects();
|
|
|
|
public:
|
|
virtual void event_init();
|
|
virtual void event_update();
|
|
};
|
|
|
|
#endif // TEXTGAME_HPP
|
|
|