-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathIComponent.hpp
79 lines (75 loc) · 2.19 KB
/
IComponent.hpp
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
//
// Created by duhieu_b on 17/03/17.
//
#ifndef CPP_ARCADE_ICOMPONENT_HPP
#define CPP_ARCADE_ICOMPONENT_HPP
#include <string>
#include "GameState.hpp"
#include "Color.hpp"
namespace arcade
{
///
/// \class IComponent
/// \brief Interface used to manage GUI components
///
class IComponent
{
public:
///
/// \fn virtual ~IComponent()
/// \brief Virtual destructor of the interface
///
virtual ~IComponent(){};
///
/// \fn virtual double getX() const = 0
/// \brief Get the X position (between 0.0 and 1.0)
///
virtual double getX() const = 0;
///
/// \fn virtual double getY() const = 0
/// \brief Get the Y position (between 0.0 and 1.0)
///
virtual double getY() const = 0;
///
/// \fn virtual double getWidht() const = 0
/// \brief Get the component's width (between 0.0 and 1.0)
///
virtual double getWidth() const = 0;
///
/// \fn virtual double getHeight() const = 0
/// \brief Get the component's height (between 0.0 and 1.0)
///
virtual double getHeight() const = 0;
///
/// \fn virtual bool hasSprite() const = 0
/// \brief Return true if the component has a sprite
///
virtual bool hasSprite() const = 0;
///
/// \fn virtual size_t getBackgroundId() const = 0
/// \brief Get the id of the background sprite
///
virtual size_t getBackgroundId() const = 0;
///
/// \fn virtual Color getBackgroundColor() const = 0
/// \brief Get the color of the background
///
virtual Color getBackgroundColor() const = 0;
///
/// \fn virtual Color getBackgroundColor() const = 0
/// \brief Get the color of the background
///
virtual Color getTextColor() const = 0;
///
/// \fn virtual std::string const &getText() const = 0
/// \brief Get the text value
///
virtual std::string const &getText() const = 0;
///
/// \fn virtual void setClicked() = 0
/// \brief Way of the lib to tell a component it was clicked
///
virtual void setClicked() = 0;
};
}
#endif //CPP_ARCADE_ICOMPONENT_HPP