#pragma once #include #include #include #include "../GUIStuff/Elements/TreeListing.hpp" #include "BookmarkListItem.hpp" #include class World; class BookmarkManager { public: BookmarkManager(World& w); void server_init_no_file(); void scale_up(const WorldScalar& scaleUpAmount); void setup_list_gui(); void refresh_gui_data(); void save_file(cereal::PortableBinaryOutputArchive& a) const; void load_file(cereal::PortableBinaryInputArchive& a, VersionNumber version); NetworkingObjects::NetObjOwnerPtr bookmarkListRoot; private: NetworkingObjects::NetObjTemporaryPtr get_bookmark_parent_from_obj_index(const GUIStuff::TreeListingObjIndexList& objIndex); NetworkingObjects::NetObjTemporaryPtr get_bookmark_from_obj_index(const GUIStuff::TreeListingObjIndexList& objIndex); std::pair> create_in_proper_position(BookmarkListItem* newItem); std::optional>> try_to_create_in_proper_position(BookmarkListItem* newItem); NetworkingObjects::NetObjOrderedListIterator create_bookmark(BookmarkListItem* newItem); void remove_bookmark(const GUIStuff::TreeListingObjIndexList& objIndex); std::string nameToEdit; std::string nameForNew; std::set selectedBookmarkIndices; NetworkingObjects::NetObjTemporaryPtr editingBookmark; std::optional editingBookmarkOldName; void editing_bookmark_check(); friend class BookmarkListItem; World& world; };