Added a container accessor
This commit is contained in:
+5
-1
@@ -45,7 +45,7 @@ void TextBox::PushLine(SDL_Renderer* renderer, TTF_Font* font, SDL_Color color,
|
|||||||
lineList.emplace_back(renderer, font, color, str, 0, 0);
|
lineList.emplace_back(renderer, font, color, str, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TextBox::PopLine(int num) {
|
void TextBox::PopLines(int num) {
|
||||||
//prevent underflow
|
//prevent underflow
|
||||||
num < lineList.size() ? num : lineList.size();
|
num < lineList.size() ? num : lineList.size();
|
||||||
|
|
||||||
@@ -73,3 +73,7 @@ int TextBox::GetX() const {
|
|||||||
int TextBox::GetY() const {
|
int TextBox::GetY() const {
|
||||||
return posY;
|
return posY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::list<TextLine>* TextBox::GetContainer() {
|
||||||
|
return &lineList;
|
||||||
|
}
|
||||||
+3
-1
@@ -37,7 +37,7 @@ public:
|
|||||||
void DrawTo(SDL_Renderer*);
|
void DrawTo(SDL_Renderer*);
|
||||||
|
|
||||||
void PushLine(SDL_Renderer*, TTF_Font*, SDL_Color color, std::string);
|
void PushLine(SDL_Renderer*, TTF_Font*, SDL_Color color, std::string);
|
||||||
void PopLine(int num = 1);
|
void PopLines(int num = 1);
|
||||||
void ClearLines();
|
void ClearLines();
|
||||||
|
|
||||||
int SetX(int i);
|
int SetX(int i);
|
||||||
@@ -45,6 +45,8 @@ public:
|
|||||||
int GetX() const;
|
int GetX() const;
|
||||||
int GetY() const;
|
int GetY() const;
|
||||||
|
|
||||||
|
std::list<TextLine>* GetContainer();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::list<TextLine> lineList;
|
std::list<TextLine> lineList;
|
||||||
int posX = 0, posY = 0;
|
int posX = 0, posY = 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user