PumpkinBrush
Erase.hpp
Go to the documentation of this file.
1 
8 #ifndef APP_ERASE_HPP
9 #define APP_ERASE_HPP
10 
11 #include <SFML/Graphics/Color.hpp>
12 
13 #include "Command.hpp"
14 #include "App.hpp"
15 
19 class Erase : public Command {
20 private:
21  sf::Vector2f m_coordinate;
22  sf::Color m_backgroundColor;
23  std::vector<std::vector<int>> m_shader;
24  std::vector<sf::Color> m_originalColors;
25  App* m_app;
26  std::vector<std::vector<int>> dir_largeEraser;
27 
28 public:
29  bool execute();
30  bool undo();
31  void setOriginalColor();
32  Erase(sf::Vector2f coordinate, App* app, int flag, std::string command);
33 };
34 
35 #endif //APP_ERASE_HPP
Erase::undo
bool undo()
Undo the erase pixel command and restore the pixels that were previously erased.
Definition: Erase.cpp:53
Command
Definition: Command.hpp:18
Erase
Erase command.
Definition: Erase.hpp:19
Erase::setOriginalColor
void setOriginalColor()
Execute the erase pixel command.
Definition: Erase.cpp:43
Erase::execute
bool execute()
The destructor of the Erase class.
Definition: Erase.cpp:31
App.hpp
App class interface.
Command.hpp
Represents an actionable command by the user.
Erase::Erase
Erase(sf::Vector2f coordinate, App *app, int flag, std::string command)
The constructor of the Erase class.
Definition: Erase.cpp:13
App
Definition: App.hpp:37