2025-07-06 20:43:53 +03:00
|
|
|
#pragma once
|
2025-09-06 19:06:30 +03:00
|
|
|
#include "WorldGrid.hpp"
|
2025-07-06 20:43:53 +03:00
|
|
|
|
2025-09-06 19:06:30 +03:00
|
|
|
class World;
|
2025-07-06 20:43:53 +03:00
|
|
|
|
|
|
|
|
class GridManager {
|
|
|
|
|
public:
|
2025-09-06 19:06:30 +03:00
|
|
|
GridManager(World& w);
|
|
|
|
|
void init_client_callbacks();
|
|
|
|
|
void add_grid(const std::string& name);
|
|
|
|
|
void remove_grid(const std::string& name);
|
2025-07-06 20:43:53 +03:00
|
|
|
void draw(SkCanvas* canvas, const DrawData& drawData);
|
2025-09-06 19:06:30 +03:00
|
|
|
const std::vector<std::string>& sorted_names();
|
2025-07-06 20:43:53 +03:00
|
|
|
|
2025-09-06 19:06:30 +03:00
|
|
|
std::unordered_map<std::string, WorldGrid> grids;
|
|
|
|
|
World& world;
|
2025-07-06 20:43:53 +03:00
|
|
|
private:
|
2025-09-06 19:06:30 +03:00
|
|
|
bool changed = true;
|
|
|
|
|
std::vector<std::string> sortedNames;
|
2025-07-06 20:43:53 +03:00
|
|
|
};
|