-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSymbolCount.cpp
More file actions
55 lines (46 loc) · 1.59 KB
/
SymbolCount.cpp
File metadata and controls
55 lines (46 loc) · 1.59 KB
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
#include "SymbolCount.h"
void SymbolCount::createString()
{
std::string temp;
for (int i = 0; i < _value;i++)
temp += _symbol;
setString(temp);
}
SymbolCount::SymbolCount(sf::Vector2f size, sf::Vector2f position, sf::Font &font, std::string src_img, int size_font, sf::Color color_font, char symbol, int value)
:counter(size, position, font, src_img, size_font, color_font)
{
_symbol = symbol;
_value = value;
createString();
CenterText();
}
SymbolCount::SymbolCount(float size_x, float size_y, float pos_x, float pos_y, sf::Font &font, std::string src_img, int size_font, sf::Color color_font, char symbol, int value)
:SymbolCount(sf::Vector2f(size_x, size_y), sf::Vector2f(pos_x, pos_y), font, src_img, size_font, color_font, symbol, value)
{
//Wywolanie przez liste wczesniejszego konstruktora
}
SymbolCount::SymbolCount(sf::Vector2f size, sf::Vector2f position, sf::Font &font, sf::Texture &src_tex, int size_font, sf::Color color_font, char symbol, int value)
:counter(size, position, font, src_tex, size_font, color_font)
{
_symbol = symbol;
_value = value;
createString();
CenterText();
}
SymbolCount::SymbolCount(float size_x, float size_y, float pos_x, float pos_y, sf::Font &font, sf::Texture &src_tex, int size_font, sf::Color color_font, char symbol, int value)
: SymbolCount(sf::Vector2f(size_x, size_y), sf::Vector2f(pos_x, pos_y), font, src_tex, size_font, color_font, symbol, value)
{
//Wywolanie przez liste wczesniejszego konstruktora
}
SymbolCount::~SymbolCount()
{
}
void SymbolCount::deleteOne()
{
_value -= 1;
createString();
}
int SymbolCount::getValue()
{
return _value;
}