From 41fa09887ac5d46193ca77997c92e74ecde9ac40 Mon Sep 17 00:00:00 2001 From: Vectozavr <60608292+vectozavr@users.noreply.github.com> Date: Wed, 13 Oct 2021 00:19:02 +0700 Subject: [PATCH] Add "final" to all classes from which we dont need to inherit. --- Shooter.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/Shooter.cpp b/Shooter.cpp index da2fe71..40d48d3 100644 --- a/Shooter.cpp +++ b/Shooter.cpp @@ -173,25 +173,25 @@ void Shooter::drawPlayerStats() { int width = screen->width()/2 - 20; int height = 10; - screen->drawTetragon(Point4D{xPos, yPos}, - Point4D{xPos + width * player->health() / player->maxHealth(), yPos}, - Point4D{xPos + width * player->health() / player->maxHealth(), yPos + height}, - Point4D{xPos, yPos + height}, + screen->drawTetragon(Vec2D{xPos, yPos}, + Vec2D{xPos + width * player->health() / player->maxHealth(), yPos}, + Vec2D{xPos + width * player->health() / player->maxHealth(), yPos + height}, + Vec2D{xPos, yPos + height}, { static_cast((player->maxHealth() - player->health())/player->maxHealth() * 255), static_cast(player->health() * 255 / player->maxHealth()), 0, 100 }); - screen->drawTetragon(Point4D{xPos, yPos - 15}, - Point4D{xPos + width * player->ability() / player->maxAbility(), yPos - 15}, - Point4D{xPos + width * player->ability() / player->maxAbility(), yPos - 15 + height}, - Point4D{xPos, yPos - 15 + height}, + screen->drawTetragon(Vec2D{xPos, yPos - 15}, + Vec2D{xPos + width * player->ability() / player->maxAbility(), yPos - 15}, + Vec2D{xPos + width * player->ability() / player->maxAbility(), yPos - 15 + height}, + Vec2D{xPos, yPos - 15 + height}, { 255, 168, 168, 100 }); auto balance = player->balance(); - screen->drawText(std::to_string((int)balance.first), Point4D{150, static_cast(screen->height() - 150)}, 100, sf::Color(0, 0, 0, 100)); - screen->drawText(std::to_string((int)balance.second), Point4D{50, static_cast(screen->height() - 100)}, 50, sf::Color(0, 0, 0, 70)); + screen->drawText(std::to_string((int)balance.first), Vec2D{150, static_cast(screen->height() - 150)}, 100, sf::Color(0, 0, 0, 100)); + screen->drawText(std::to_string((int)balance.second), Vec2D{50, static_cast(screen->height() - 100)}, 50, sf::Color(0, 0, 0, 70)); screen->drawText("KILLS: " + std::to_string(player->kills()) + " | " + "DEATHS: " + std::to_string(player->deaths()), - Point4D{10, 10},25, sf::Color(0, 0, 0, 100)); + Vec2D{10, 10},25, sf::Color(0, 0, 0, 100)); } void Shooter::play() {