Got rid of AnimView, added Gui

This commit is contained in:
2021-02-07 13:38:29 -05:00
parent 0721d29c72
commit 1ff94e2591
13 changed files with 118 additions and 123 deletions

View File

@@ -3,6 +3,7 @@
#include "world.hpp"
#include "animqueue.hpp"
#include "gui.hpp"
#include <vector>
#include <string>
#include <memory>
@@ -10,7 +11,6 @@
class Viewer {
private:
std::unique_ptr<World> world_;
AnimViewMap view_map_;
public:
Viewer();
@@ -24,17 +24,21 @@ public:
//
int64_t get_player_id();
// Update the view map.
// Get the list of tangibles near the player.
//
void update_view_map() { world_->update_view_map(&view_map_, 1, 100); }
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); }
// Get the view map.
// Update the GUI for the specified sprite.
//
AnimViewMap &get_view_map() { return view_map_; }
// Get the menu of the specified tangible.
// The gui passed in can be either a newly-created empty GUI,
// which will be populated, or a GUI object retained from
// the previous frame, which will be updated.
//
std::vector<std::string> get_menu(int64_t id);
void update_gui(int64_t id, Gui *g);
};
#endif // VIEWER_HPP