-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmenuItem.cpp
More file actions
49 lines (38 loc) · 877 Bytes
/
menuItem.cpp
File metadata and controls
49 lines (38 loc) · 877 Bytes
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
#include "menuItem.h"
using namespace Core;
//{ Lifecycle
/**
* Constructor
*/
MenuItem::MenuItem(const std::string& name_, const std::string& imagePath_)
{
_name = name_;
_imagePath = imagePath_;
_colour = SDL_Colour { 0xFF, 0xFF, 0xFF, 0xFF };
}
//}
//{ Properties
/**
* Gets the display name of this command.
*/
const std::string& MenuItem::name(void) const { return _name; }
/**
* Gets the file path of an image to represent this command.
*/
const std::string& MenuItem::imagePath(void) const { return _imagePath; }
/**
* @return The display text colour of this item.
*/
SDL_Colour MenuItem::colour(void) const { return _colour; }
SDL_Colour MenuItem::colour(const SDL_Colour& colour_)
{
_colour = colour_;
return _colour;
}
//}
//{ Methods
const bool MenuItem::equals(MenuItem other) const
{
return _name == other.name();
}
///}