Initial Commit

This commit is contained in:
Yousef Khadadeh 2025-07-06 20:43:53 +03:00
commit 6088fc29ed
978 changed files with 353647 additions and 0 deletions

34
src/BookmarkManager.hpp Normal file
View file

@ -0,0 +1,34 @@
#pragma once
#include <Helpers/Serializers.hpp>
#include <cereal/types/string.hpp>
#include "SharedTypes.hpp"
#include "CoordSpaceHelper.hpp"
struct Bookmark {
CoordSpaceHelper coords;
Vector<int32_t, 2> windowSize;
template <class Archive> void serialize(Archive& a) {
a(coords, windowSize);
}
};
class World;
class BookmarkManager {
public:
BookmarkManager(World& w);
void init_client_callbacks();
void add_bookmark(const std::string& name);
void remove_bookmark(const std::string& name);
void jump_to_bookmark(const std::string& name);
const std::unordered_map<std::string, Bookmark>& bookmark_list();
template <typename Archive> void serialize(Archive& a) {
a(bookmarks);
}
const std::vector<std::string>& sorted_names();
private:
bool changed = true;
std::vector<std::string> sortedNames;
std::unordered_map<std::string, Bookmark> bookmarks;
World& world;
};