summaryrefslogtreecommitdiff
path: root/src/editor.hpp
blob: 97af5b4f1f6f8de5488d1018949aacee4b0119eb (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
#pragma once

#include <SFML/Graphics/RenderWindow.hpp>
#include <SFML/Graphics/Texture.hpp>
#include <memory>
#include <optional>
#include <string>

#include "floor.hpp"
#include "tileset.hpp"

namespace silly::editor {
  struct NewTileState {
      std::string path;
      sf::Texture texture;
      TilesetTileType type;
  };

  class Editor {
    public:
      Editor(Tileset &tileset, TileFloor &floor)
          : tileset(tileset), floor(floor) {}

      void update(const sf::RenderWindow &window);
      void render(const sf::RenderWindow &window);

    private:
      Tileset &tileset;
      TileFloor &floor;

      std::optional<std::shared_ptr<TilesetTile>> selectedTile;
      std::optional<NewTileState> newTileState;
  };
}