diff --git a/src/Menu.h b/src/Menu.h index be30111..89a6168 100644 --- a/src/Menu.h +++ b/src/Menu.h @@ -37,8 +37,6 @@ class Menu final std::pair mousePosition, InputAction action, unsigned int currentItem) const; - bool itemPicked(const ALLEGRO_EVENT& event) const; - void redraw(unsigned int currentItem); unsigned int getLocationOfFirstItem() const; diff --git a/src/PointUtils.h b/src/PointUtils.h index de1c10a..88fea64 100644 --- a/src/PointUtils.h +++ b/src/PointUtils.h @@ -6,8 +6,6 @@ namespace PointUtils { Point pointFromSigned(int x, int y); -bool isValidPoint(int x, int y); - bool isValidPoint(int x, int y, unsigned int objectSize); bool isValidPoint(Point point); diff --git a/src/Screen.cpp b/src/Screen.cpp index f556a08..e4a8df9 100644 --- a/src/Screen.cpp +++ b/src/Screen.cpp @@ -84,14 +84,6 @@ void Screen::drawBackground(ResourceType resourceType) const static_cast(getHeight()), 0); } -void Screen::drawBitmap(ResourceType resourceType, unsigned int x, - unsigned int y) const -{ - ALLEGRO_BITMAP* bitmapToUse{resources_.getBitmap(resourceType)}; - al_draw_bitmap(bitmapToUse, static_cast(x), static_cast(y), - 0); -} - void Screen::drawScaledSquareBitmap(ResourceType resourceType, unsigned int x, unsigned int y, unsigned int size) const { @@ -149,11 +141,6 @@ unsigned int Screen::getWidth() const { return width_; } unsigned int Screen::getHeight() const { return height_; } -std::pair Screen::getCenter() const -{ - return {width_ / 2, height_ / 2}; -} - unsigned int Screen::getCenterX() const { return width_ / 2; } unsigned int Screen::getCenterY() const { return height_ / 2; } @@ -189,5 +176,3 @@ void Screen::useWindowedMode() false); updateSize(); } - -const Resources& Screen::getResources() const { return resources_; } diff --git a/src/Screen.h b/src/Screen.h index f9aeaa7..1b2afd6 100644 --- a/src/Screen.h +++ b/src/Screen.h @@ -8,7 +8,7 @@ struct ALLEGRO_FONT; struct ALLEGRO_BITMAP; struct ALLEGRO_COLOR; -class Screen final +class Screen { public: explicit Screen(Resources resources); @@ -29,9 +29,6 @@ class Screen final void drawBackground(ResourceType resourceType) const; - void drawBitmap(ResourceType resourceType, unsigned int x, - unsigned int y) const; - void drawScaledSquareBitmap(ResourceType resourceType, unsigned int x, unsigned int y, unsigned int size) const; @@ -53,18 +50,16 @@ class Screen final unsigned int getBitmapHeight(ResourceType resourceType) const; - static void refresh() ; + static void refresh(); - static void showMouse() ; + static void showMouse(); - static void hideMouse() ; + static void hideMouse(); void useFullScreenMode(); void useWindowedMode(); - const Resources& getResources() const; - unsigned int getWidth() const; unsigned int getHeight() const; @@ -72,8 +67,6 @@ class Screen final private: void updateSize(); - std::pair getCenter() const; - Resources resources_; unsigned int width_; diff --git a/src/Tank.cpp b/src/Tank.cpp index 6008a4f..a3cc361 100644 --- a/src/Tank.cpp +++ b/src/Tank.cpp @@ -165,8 +165,6 @@ bool Tank::isWithin(Point point) const point.y >= getY() && point.y < getY() + tileSize; } -void Tank::resetFire() { lastFire_ = TimePoint(); } - void Tank::move(Point point) { setX(point.x); diff --git a/src/Tank.h b/src/Tank.h index 9f8c284..16d0421 100644 --- a/src/Tank.h +++ b/src/Tank.h @@ -28,7 +28,6 @@ class Tank : public Drawable using TimePoint = std::chrono::time_point; Bullet fire(TimePoint currentTime); bool canFire(TimePoint currentTime) const; - void resetFire(); bool hit(unsigned int power); void move(Point point); diff --git a/test/TankTest.cpp b/test/TankTest.cpp index 4f8006b..a44fb06 100644 --- a/test/TankTest.cpp +++ b/test/TankTest.cpp @@ -293,15 +293,6 @@ TEST_CASE("firing", "[tank]") tank.fire(firstFireTime); REQUIRE(tank.canFire(firstFireTime + delay) == true); } - - SECTION("reset fire") - { - Tank tank(TankType::PLAYER_TIER_1, point); - const TimePoint firstFireTime{TimePoint() + delay}; - tank.fire(firstFireTime); - tank.resetFire(); - REQUIRE(tank.canFire(firstFireTime + delay / 2) == true); - } } TEST_CASE("power-ups", "[tank]")