Added invoke_plan, removed viewer

This commit is contained in:
2021-02-16 13:31:34 -05:00
parent eefe1bd58a
commit 1a6366e164
11 changed files with 128 additions and 110 deletions

View File

@@ -1,46 +0,0 @@
#ifndef VIEWER_HPP
#define VIEWER_HPP
#include "world.hpp"
#include "animqueue.hpp"
#include "gui.hpp"
#include <vector>
#include <string>
#include <memory>
class Viewer {
private:
std::unique_ptr<World> world_;
public:
Viewer();
~Viewer();
// Snapshot/rollback the lua state (temporary hack)
void snapshot() { world_->lua_snap_.snapshot(); }
void rollback() { world_->lua_snap_.rollback(); }
// Get the lua state for interaction.
//
lua_State *state() { return world_->state(); }
// Get the player ID of the current player.
//
int64_t get_player_id();
// Get the list of tangibles near the player.
//
std::vector<int64_t> get_near() { return world_->get_near(1, 100); }
// Get the specified tangible.
//
const Tangible *tangible_get(int64_t id) { return world_->tangible_get(id); }
// Update the GUI for the specified sprite.
//
// The gui passed in will be overwritten.
//
void update_gui(int64_t id, Gui *g);
};
#endif // VIEWER_HPP