blob: 815b91c62835696ae3213526f2981ca3aa1f549c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
#pragma once
#include "editor-enums.hpp"
#include "src/rotation.hpp"
#include "src/global-coords.hpp"
#include <memory>
#include <map>
namespace floormat {
struct world;
class wall_atlas;
class wall_editor
{
std::map<StringView, std::shared_ptr<wall_atlas>> _atlases;
std::shared_ptr<wall_atlas> _selected_atlas;
rotation _r = rotation::N;
void load_atlases();
public:
wall_editor();
StringView name() const;
enum rotation rotation() const { return _r; }
void set_rotation(enum rotation r);
void toggle_rotation();
std::shared_ptr<wall_atlas> get_selected() const { return _selected_atlas; }
void select_atlas(const std::shared_ptr<wall_atlas>& atlas);
void clear_selection();
bool is_atlas_selected(const std::shared_ptr<wall_atlas>& atlas) const;
bool is_anything_selected() const;
void place_tile(world& w, global_coords coords, const std::shared_ptr<wall_atlas>& atlas);
editor_snap_mode check_snap(int mods) const;
};
} // namespace floormat
|