Debian Codegraph @

src/gengine/MouseStroke.h

raw
1 #ifndef HEADER_MOUSESTROKE_H
2 #define HEADER_MOUSESTROKE_H
3
4 #include "V2.h"
5
6 #include "SDL.h"
7 #include <string>
8
9 /**
10 * Contains info about mouse click.
11 */
12 class MouseStroke {
13 private:
14 Uint8 m_button;
15 V2 m_loc;
16 public:
17 MouseStroke(const SDL_MouseButtonEvent &event);
18
19 bool isLeft() const { return m_button == SDL_BUTTON_LEFT; }
20 bool isMiddle() const { return m_button == SDL_BUTTON_MIDDLE; }
21 bool isRight() const { return m_button == SDL_BUTTON_RIGHT; }
22 V2 getLoc() const { return m_loc; }
23 std::string toString() const;
24 };
25
26 #endif