treball en curs: correccions de tidy
This commit is contained in:
@@ -4,32 +4,32 @@
|
||||
|
||||
// Constructor
|
||||
Writer::Writer(Text *text)
|
||||
: text(text) {
|
||||
: text_(text) {
|
||||
}
|
||||
|
||||
// Actualiza el objeto
|
||||
void Writer::update() {
|
||||
if (enabled) {
|
||||
if (!completed) { // No completado
|
||||
if (writingCounter > 0) {
|
||||
writingCounter--;
|
||||
if (enabled_) {
|
||||
if (!completed_) { // No completado
|
||||
if (writing_counter_ > 0) {
|
||||
writing_counter_--;
|
||||
}
|
||||
|
||||
else if (writingCounter == 0) {
|
||||
index++;
|
||||
writingCounter = speed;
|
||||
else if (writing_counter_ == 0) {
|
||||
index_++;
|
||||
writing_counter_ = speed_;
|
||||
}
|
||||
|
||||
if (index == lenght) {
|
||||
completed = true;
|
||||
if (index_ == length_) {
|
||||
completed_ = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (completed) { // Completado
|
||||
if (enabledCounter > 0) {
|
||||
enabledCounter--;
|
||||
} else if (enabledCounter == 0) {
|
||||
finished = true;
|
||||
if (completed_) { // Completado
|
||||
if (enabled_counter_ > 0) {
|
||||
enabled_counter_--;
|
||||
} else if (enabled_counter_ == 0) {
|
||||
finished_ = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -37,64 +37,64 @@ void Writer::update() {
|
||||
|
||||
// Dibuja el objeto en pantalla
|
||||
void Writer::render() {
|
||||
if (enabled) {
|
||||
text->write(posX, posY, caption, kerning, index);
|
||||
if (enabled_) {
|
||||
text_->write(pos_x_, pos_y_, caption_, kerning_, index_);
|
||||
}
|
||||
}
|
||||
|
||||
// Establece el valor de la variable
|
||||
void Writer::setPosX(int value) {
|
||||
posX = value;
|
||||
pos_x_ = value;
|
||||
}
|
||||
|
||||
// Establece el valor de la variable
|
||||
void Writer::setPosY(int value) {
|
||||
posY = value;
|
||||
pos_y_ = value;
|
||||
}
|
||||
|
||||
// Establece el valor de la variable
|
||||
void Writer::setKerning(int value) {
|
||||
kerning = value;
|
||||
kerning_ = value;
|
||||
}
|
||||
|
||||
// Establece el valor de la variable
|
||||
void Writer::setCaption(const std::string &text) {
|
||||
caption = text;
|
||||
lenght = text.length();
|
||||
caption_ = text;
|
||||
length_ = text.length();
|
||||
}
|
||||
|
||||
// Establece el valor de la variable
|
||||
void Writer::setSpeed(int value) {
|
||||
speed = value;
|
||||
writingCounter = value;
|
||||
speed_ = value;
|
||||
writing_counter_ = value;
|
||||
}
|
||||
|
||||
// Establece el valor de la variable
|
||||
void Writer::setEnabled(bool value) {
|
||||
enabled = value;
|
||||
enabled_ = value;
|
||||
}
|
||||
|
||||
// Obtiene el valor de la variable
|
||||
auto Writer::IsEnabled() const -> bool {
|
||||
return enabled;
|
||||
auto Writer::isEnabled() const -> bool {
|
||||
return enabled_;
|
||||
}
|
||||
|
||||
// Establece el valor de la variable
|
||||
void Writer::setEnabledCounter(int time) {
|
||||
enabledCounter = time;
|
||||
enabled_counter_ = time;
|
||||
}
|
||||
|
||||
// Obtiene el valor de la variable
|
||||
auto Writer::getEnabledCounter() const -> int {
|
||||
return enabledCounter;
|
||||
return enabled_counter_;
|
||||
}
|
||||
|
||||
// Centra la cadena de texto a un punto X
|
||||
void Writer::center(int x) {
|
||||
setPosX(x - (text->lenght(caption, kerning) / 2));
|
||||
setPosX(x - (text_->lenght(caption_, kerning_) / 2));
|
||||
}
|
||||
|
||||
// Obtiene el valor de la variable
|
||||
auto Writer::hasFinished() const -> bool {
|
||||
return finished;
|
||||
return finished_;
|
||||
}
|
||||
Reference in New Issue
Block a user