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

@@ -77,7 +77,7 @@ private:
int64_t id_;
int size_limit_;
std::deque<AnimStep> steps_;
public:
public:
AnimQueue();
int64_t get_id() const { return id_; }
void set_id(int64_t id) { id_ = id; }
@@ -100,35 +100,5 @@ public:
void set_size_limit(int n);
};
class AnimView {
friend class AnimViewMap;
private:
int64_t id_;
std::string graphic_;
std::string plane_;
util::XYZ xyz_;
bool updated_; // Used by AnimViewMap.
public:
AnimView() : id_(0), updated_(true) {}
int64_t get_id() const { return id_; }
const std::string &get_graphic() const { return graphic_; }
const std::string &get_plane() const { return plane_; }
const util::XYZ &get_xyz() const { return xyz_; }
void update_from(const AnimQueue &queue);
};
// AnimViewMap: a unordered_map from tangible ID to AnimView. Adds a few
// methods for garbage collection and updating.
//
class AnimViewMap : public std::unordered_map<int64_t, AnimView> {
public:
AnimView *get_one(int64_t id);
void clear_updated_bits();
void delete_non_updated();
void update_one(const AnimQueue &queue);
};
#endif // ANIMQUEUE_HPP