Skip to content

Commit

Permalink
GameObject: get_coins() -> get_coins_worth()
Browse files Browse the repository at this point in the history
  • Loading branch information
Vankata453 committed Nov 23, 2024
1 parent d337654 commit 098af23
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/badguy/goldbomb.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class GoldBomb final : public MrBomb
virtual GameObjectClasses get_class_types() const override { return WalkingBadguy::get_class_types().add(typeid(GoldBomb)); }
virtual bool is_snipable() const override { return true; }

int get_coins() const override { return 10; }
int get_coins_worth() const override { return 10; }

virtual void explode() override;

Expand Down
2 changes: 1 addition & 1 deletion src/object/bonus_block.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ BonusBlock::get_settings()
}

int
BonusBlock::get_coins() const
BonusBlock::get_coins_worth() const
{
if (m_contents == BonusBlock::Content::COIN)
return m_hit_counter;
Expand Down
2 changes: 1 addition & 1 deletion src/object/bonus_block.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class BonusBlock final : public Block
GameObjectTypes get_types() const override;
std::string get_default_sprite_name() const override;

int get_coins() const override;
int get_coins_worth() const override;

Content get_contents() const { return m_contents; }
int get_hit_counter() const { return m_hit_counter; }
Expand Down
2 changes: 1 addition & 1 deletion src/object/coin.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class Coin : public MovingSprite,
virtual void after_editor_set() override;
virtual void editor_update() override;

int get_coins() const override { return 1; }
int get_coins_worth() const override { return 1; }

void save_state() override;
void check_state() override;
Expand Down
2 changes: 1 addition & 1 deletion src/supertux/game_object.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ class GameObject : public ExposableClass

/** Returns the amount of coins that this object is worth.
This is considered when calculating all coins in a level. */
virtual int get_coins() const { return 0; }
virtual int get_coins_worth() const { return 0; }

/** Indicates if get_settings() is implemented. If true the editor
will display Tip and ObjectMenu. */
Expand Down
2 changes: 1 addition & 1 deletion src/supertux/level.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ Level::get_total_coins() const
for (auto const& sector : m_sectors)
{
for (const auto& obj : sector->get_objects())
total_coins += obj->get_coins();
total_coins += obj->get_coins_worth();
}
return total_coins;
}
Expand Down

0 comments on commit 098af23

Please sign in to comment.