Skip to content

Commit

Permalink
Revert "Index by base classes in GameObjectManager::m_objects_by_type…
Browse files Browse the repository at this point in the history
…_index (#2991)"

This reverts commit df670e4.
  • Loading branch information
weluvgoatz committed Jul 8, 2024
1 parent 47541be commit 15a29c6
Show file tree
Hide file tree
Showing 181 changed files with 35 additions and 249 deletions.
1 change: 0 additions & 1 deletion src/badguy/angrystone.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ class AngryStone final : public BadGuy
virtual std::string get_class_name() const override { return class_name(); }
static std::string display_name() { return _("Angry Stone"); }
virtual std::string get_display_name() const override { return display_name(); }
virtual GameObjectClasses get_class_types() const override { return BadGuy::get_class_types().add(typeid(AngryStone)); }

protected:
virtual std::vector<Direction> get_allowed_directions() const override;
Expand Down
1 change: 0 additions & 1 deletion src/badguy/badguy.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ class BadGuy : public MovingSprite,
virtual std::string get_exposed_class_name() const override { return "BadGuy"; }
static std::string display_name() { return _("Badguy"); }
virtual std::string get_display_name() const override { return display_name(); }
virtual GameObjectClasses get_class_types() const override { return MovingSprite::get_class_types().add(typeid(Portable)).add(typeid(BadGuy)); }

virtual std::string get_overlay_size() const { return "1x1"; }

Expand Down
1 change: 0 additions & 1 deletion src/badguy/bomb.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ class Bomb final : public BadGuy
{
public:
Bomb(const Vector& pos, Direction dir, const std::string& custom_sprite = "images/creatures/mr_bomb/bomb.sprite" );
virtual GameObjectClasses get_class_types() const override { return BadGuy::get_class_types().add(typeid(Bomb)); }
virtual bool is_saveable() const override {
return false;
}
Expand Down
1 change: 0 additions & 1 deletion src/badguy/bouncing_snowball.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ class BouncingSnowball final : public BadGuy
virtual std::string get_class_name() const override { return class_name(); }
static std::string display_name() { return _("Bouncing Snowball"); }
virtual std::string get_display_name() const override { return display_name(); }
virtual GameObjectClasses get_class_types() const override { return BadGuy::get_class_types().add(typeid(BouncingSnowball)); }

virtual GameObjectTypes get_types() const override;
virtual std::string get_default_sprite_name() const override;
Expand Down
1 change: 0 additions & 1 deletion src/badguy/captainsnowball.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ class CaptainSnowball final : public WalkingBadguy
virtual std::string get_class_name() const override { return class_name(); }
static std::string display_name() { return _("Captain Snowball"); }
virtual std::string get_display_name() const override { return display_name(); }
virtual GameObjectClasses get_class_types() const override { return WalkingBadguy::get_class_types().add(typeid(CaptainSnowball)); }
virtual bool is_snipable() const override { return true; }

bool might_climb(int width, int height) const;
Expand Down
1 change: 0 additions & 1 deletion src/badguy/corrupted_granito.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ class CorruptedGranito final : public BadGuy
virtual std::string get_class_name() const override { return class_name(); }
static std::string display_name() { return _("Corrupted Granito"); }
virtual std::string get_display_name() const override { return display_name(); }
virtual GameObjectClasses get_class_types() const override { return BadGuy::get_class_types().add(typeid(CorruptedGranito)); }
virtual bool is_snipable() const override { return true; }
virtual bool is_flammable() const override { return m_type != GRANITO; }

Expand Down
1 change: 0 additions & 1 deletion src/badguy/corrupted_granito_big.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ class CorruptedGranitoBig final : public BadGuy
virtual std::string get_class_name() const override { return class_name(); }
static std::string display_name() { return _("Corrupted Big Granito"); }
virtual std::string get_display_name() const override { return display_name(); }
virtual GameObjectClasses get_class_types() const override { return BadGuy::get_class_types().add(typeid(CorruptedGranitoBig)); }

virtual bool is_snipable() const override { return false; }
virtual bool is_freezable() const override { return false; }
Expand Down
2 changes: 0 additions & 2 deletions src/badguy/crusher.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ class Crusher final : public MovingSprite
virtual std::string get_class_name() const override { return class_name(); }
static std::string display_name() { return _("Crusher"); }
virtual std::string get_display_name() const override { return display_name(); }
virtual GameObjectClasses get_class_types() const override { return MovingSprite::get_class_types().add(typeid(Crusher)); }

virtual ObjectSettings get_settings() override;
GameObjectTypes get_types() const override;
Expand Down Expand Up @@ -116,7 +115,6 @@ class CrusherRoot : public MovingSprite
{
public:
CrusherRoot(Vector position, Crusher::Direction direction, float delay, int layer);
virtual GameObjectClasses get_class_types() const override { return MovingSprite::get_class_types().add(typeid(CrusherRoot)); }

virtual HitResponse collision(GameObject& other, const CollisionHit& hit) override;
virtual void update(float dt_sec) override;
Expand Down
1 change: 0 additions & 1 deletion src/badguy/crystallo.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ class Crystallo final : public WalkingBadguy
virtual std::string get_class_name() const override { return class_name(); }
static std::string display_name() { return _("Crystallo"); }
virtual std::string get_display_name() const override { return display_name(); }
virtual GameObjectClasses get_class_types() const override { return WalkingBadguy::get_class_types().add(typeid(Crystallo)); }

virtual void active_update(float dt_sec) override;
virtual bool is_flammable() const override;
Expand Down
1 change: 0 additions & 1 deletion src/badguy/dart.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ class Dart final : public BadGuy
virtual std::string get_class_name() const override { return class_name(); }
static std::string display_name() { return _("Dart"); }
virtual std::string get_display_name() const override { return display_name(); }
virtual GameObjectClasses get_class_types() const override { return BadGuy::get_class_types().add(typeid(Dart)); }

virtual bool is_flammable() const override;

Expand Down
1 change: 0 additions & 1 deletion src/badguy/darttrap.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ class DartTrap final : public StickyBadguy
virtual std::string get_class_name() const override { return class_name(); }
static std::string display_name() { return _("Dart Trap"); }
virtual std::string get_display_name() const override { return display_name(); }
virtual GameObjectClasses get_class_types() const override { return StickyBadguy::get_class_types().add(typeid(DartTrap)); }

virtual ObjectSettings get_settings() override;
virtual GameObjectTypes get_types() const override;
Expand Down
1 change: 0 additions & 1 deletion src/badguy/dispenser.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ class Dispenser final : public BadGuy
virtual std::string get_exposed_class_name() const override { return "Dispenser"; }
static std::string display_name() { return _("Dispenser"); }
virtual std::string get_display_name() const override { return display_name(); }
virtual GameObjectClasses get_class_types() const override { return BadGuy::get_class_types().add(typeid(Dispenser)); }

virtual ObjectSettings get_settings() override;
virtual GameObjectTypes get_types() const override;
Expand Down
1 change: 0 additions & 1 deletion src/badguy/dive_mine.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ class DiveMine final : public BadGuy
virtual std::string get_class_name() const override { return class_name(); }
static std::string display_name() { return _("Dive Mine"); }
virtual std::string get_display_name() const override { return display_name(); }
virtual GameObjectClasses get_class_types() const override { return BadGuy::get_class_types().add(typeid(DiveMine)); }

protected:
virtual std::vector<Direction> get_allowed_directions() const override;
Expand Down
1 change: 0 additions & 1 deletion src/badguy/fish_chasing.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ class FishChasing final : public FishSwimming
static std::string display_name() { return _("Chasing Fish"); }
virtual std::string get_display_name() const override { return display_name(); }
virtual std::string get_overlay_size() const override { return "2x2"; }
virtual GameObjectClasses get_class_types() const override { return FishSwimming::get_class_types().add(typeid(FishChasing)); }
virtual ObjectSettings get_settings() override;

std::string get_default_sprite_name() const override;
Expand Down
1 change: 0 additions & 1 deletion src/badguy/fish_harmless.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ class FishHarmless final : public FishSwimming
virtual std::string get_class_name() const override { return class_name(); }
static std::string display_name() { return _("Harmless Fish"); }
virtual std::string get_display_name() const override { return display_name(); }
virtual GameObjectClasses get_class_types() const override { return FishSwimming::get_class_types().add(typeid(FishHarmless)); }
virtual std::string get_overlay_size() const override { return "1x1"; }

GameObjectTypes get_types() const override { return {}; }
Expand Down
1 change: 0 additions & 1 deletion src/badguy/fish_jumping.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ class FishJumping final : public BadGuy
virtual std::string get_class_name() const override { return class_name(); }
static std::string display_name() { return _("Jumping Fish"); }
virtual std::string get_display_name() const override { return display_name(); }
virtual GameObjectClasses get_class_types() const override { return BadGuy::get_class_types().add(typeid(FishJumping)); }

protected:
virtual std::vector<Direction> get_allowed_directions() const override;
Expand Down
1 change: 0 additions & 1 deletion src/badguy/fish_swimming.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ class FishSwimming : public BadGuy
static std::string display_name() { return _("Swimming Fish"); }
virtual std::string get_display_name() const override { return display_name(); }
virtual std::string get_overlay_size() const override { return "2x1"; }
virtual GameObjectClasses get_class_types() const override { return BadGuy::get_class_types().add(typeid(FishSwimming)); }
virtual ObjectSettings get_settings() override;

virtual GameObjectTypes get_types() const override;
Expand Down
1 change: 0 additions & 1 deletion src/badguy/flame.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ class Flame final : public BadGuy
virtual std::string get_class_name() const override { return class_name(); }
static std::string display_name() { return _("Flame"); }
virtual std::string get_display_name() const override { return display_name(); }
virtual GameObjectClasses get_class_types() const override { return BadGuy::get_class_types().add(typeid(Flame)); }

virtual void stop_looping_sounds() override;
virtual void play_looping_sounds() override;
Expand Down
1 change: 0 additions & 1 deletion src/badguy/flyingsnowball.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ class FlyingSnowBall final : public BadGuy
virtual std::string get_class_name() const override { return class_name(); }
static std::string display_name() { return _("Flying Snowball"); }
virtual std::string get_display_name() const override { return display_name(); }
virtual GameObjectClasses get_class_types() const override { return BadGuy::get_class_types().add(typeid(FlyingSnowBall)); }
virtual bool is_snipable() const override { return true; }

protected:
Expand Down
1 change: 0 additions & 1 deletion src/badguy/ghosttree.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ class GhostTree final : public BadGuy
virtual std::string get_class_name() const override { return class_name(); }
static std::string display_name() { return _("Ghost Tree"); }
virtual std::string get_display_name() const override { return display_name(); }
virtual GameObjectClasses get_class_types() const override { return BadGuy::get_class_types().add(typeid(GhostTree)); }

virtual void on_flip(float height) override;

Expand Down
1 change: 0 additions & 1 deletion src/badguy/ghoul.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ class Ghoul final : public BadGuy,
static std::string display_name() { return _("Ghoul"); }
std::string get_class_name() const override { return class_name(); }
std::string get_display_name() const override { return display_name(); }
virtual GameObjectClasses get_class_types() const override { return BadGuy::get_class_types().add(typeid(Ghoul)); }
bool is_freezable() const override;
bool is_flammable() const override;
virtual bool is_snipable() const override { return true; }
Expand Down
1 change: 0 additions & 1 deletion src/badguy/goldbomb.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ class GoldBomb final : public WalkingBadguy
virtual std::string get_class_name() const override { return class_name(); }
static std::string display_name() { return _("Gold Bomb"); }
virtual std::string get_display_name() const override { return display_name(); }
virtual GameObjectClasses get_class_types() const override { return WalkingBadguy::get_class_types().add(typeid(GoldBomb)); }
virtual bool is_snipable() const override { return true; }

virtual void stop_looping_sounds() override;
Expand Down
1 change: 0 additions & 1 deletion src/badguy/granito.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ class Granito : public WalkingBadguy
virtual std::string get_exposed_class_name() const override { return "Granito"; }
static std::string display_name() { return _("Granito"); }
virtual std::string get_display_name() const override { return display_name(); }
virtual GameObjectClasses get_class_types() const override { return WalkingBadguy::get_class_types().add(typeid(Granito)); }

virtual bool is_snipable() const override { return false; }
virtual bool is_freezable() const override { return false; }
Expand Down
1 change: 0 additions & 1 deletion src/badguy/granito_big.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ class GranitoBig final : public Granito
virtual std::string get_exposed_class_name() const override { return "GranitoBig"; }
static std::string display_name() { return _("Big Granito"); }
virtual std::string get_display_name() const override { return display_name(); }
virtual GameObjectClasses get_class_types() const override { return Granito::get_class_types().add(typeid(GranitoBig)); }

virtual ObjectSettings get_settings() override;
virtual GameObjectTypes get_types() const override;
Expand Down
1 change: 0 additions & 1 deletion src/badguy/granito_giant.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ class GranitoGiant final : public BadGuy
virtual std::string get_class_name() const override { return class_name(); }
static std::string display_name() { return _("Giant Granito"); }
virtual std::string get_display_name() const override { return display_name(); }
virtual GameObjectClasses get_class_types() const override { return BadGuy::get_class_types().add(typeid(GranitoGiant)); }

virtual void kill_fall() override;

Expand Down
1 change: 0 additions & 1 deletion src/badguy/haywire.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ class Haywire final : public WalkingBadguy
virtual std::string get_class_name() const override { return class_name(); }
static std::string display_name() { return _("Haywire"); }
virtual std::string get_display_name() const override { return display_name(); }
virtual GameObjectClasses get_class_types() const override { return WalkingBadguy::get_class_types().add(typeid(Haywire)); }
virtual bool is_snipable() const override { return true; }

inline bool is_exploding() const { return m_is_exploding; }
Expand Down
1 change: 0 additions & 1 deletion src/badguy/igel.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ class Igel final : public WalkingBadguy
virtual std::string get_class_name() const override { return class_name(); }
static std::string display_name() { return _("Igel"); }
virtual std::string get_display_name() const override { return display_name(); }
virtual GameObjectClasses get_class_types() const override { return WalkingBadguy::get_class_types().add(typeid(Igel)); }

virtual bool is_freezable() const override { return true; }
virtual void unfreeze(bool melt = true) override;
Expand Down
1 change: 0 additions & 1 deletion src/badguy/jumpy.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ class Jumpy final : public BadGuy
virtual std::string get_class_name() const override { return class_name(); }
static std::string display_name() { return _("Jumpy"); }
virtual std::string get_display_name() const override { return display_name(); }
virtual GameObjectClasses get_class_types() const override { return BadGuy::get_class_types().add(typeid(Jumpy)); }

GameObjectTypes get_types() const override;
std::string get_default_sprite_name() const override;
Expand Down
2 changes: 0 additions & 2 deletions src/badguy/kamikazesnowball.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ class KamikazeSnowball : public BadGuy
virtual std::string get_class_name() const override { return class_name(); }
static std::string display_name() { return _("Kamikaze Snowball"); }
virtual std::string get_display_name() const override { return display_name(); }
virtual GameObjectClasses get_class_types() const override { return BadGuy::get_class_types().add(typeid(KamikazeSnowball)); }
virtual bool is_snipable() const override { return true; }

protected:
Expand Down Expand Up @@ -64,7 +63,6 @@ class LeafShot final : public KamikazeSnowball
virtual std::string get_class_name() const override { return class_name(); }
static std::string display_name() { return _("Leafshot"); }
virtual std::string get_display_name() const override { return display_name(); }
virtual GameObjectClasses get_class_types() const override { return KamikazeSnowball::get_class_types().add(typeid(LeafShot)); }

virtual bool is_snipable() const override { return true; }

Expand Down
1 change: 0 additions & 1 deletion src/badguy/kugelblitz.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ class Kugelblitz final : public BadGuy
virtual std::string get_class_name() const override { return class_name(); }
static std::string display_name() { return _("Kugelblitz"); }
virtual std::string get_display_name() const override { return display_name(); }
virtual GameObjectClasses get_class_types() const override { return BadGuy::get_class_types().add(typeid(Kugelblitz)); }

void explode();

Expand Down
3 changes: 0 additions & 3 deletions src/badguy/livefire.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ class LiveFire : public WalkingBadguy
virtual std::string get_class_name() const override { return class_name(); }
static std::string display_name() { return _("Walking Flame"); }
virtual std::string get_display_name() const override { return display_name(); }
virtual GameObjectClasses get_class_types() const override { return WalkingBadguy::get_class_types().add(typeid(LiveFire)); }

private:
std::string death_sound;
Expand Down Expand Up @@ -71,7 +70,6 @@ class LiveFireAsleep final : public LiveFire
virtual std::string get_class_name() const override { return class_name(); }
static std::string display_name() { return _("Sleeping Flame"); }
virtual std::string get_display_name() const override { return display_name(); }
virtual GameObjectClasses get_class_types() const override { return LiveFire::get_class_types().add(typeid(LiveFireAsleep)); }

private:
LiveFireAsleep(const LiveFireAsleep&) = delete;
Expand All @@ -90,7 +88,6 @@ class LiveFireDormant final : public LiveFire
virtual std::string get_class_name() const override { return class_name(); }
static std::string display_name() { return _("Dormant Flame"); }
virtual std::string get_display_name() const override { return display_name(); }
virtual GameObjectClasses get_class_types() const override { return LiveFire::get_class_types().add(typeid(LiveFireDormant)); }

private:
LiveFireDormant(const LiveFireDormant&) = delete;
Expand Down
1 change: 0 additions & 1 deletion src/badguy/mole.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ class Mole final : public BadGuy
virtual std::string get_class_name() const override { return class_name(); }
static std::string display_name() { return _("Mole"); }
virtual std::string get_display_name() const override { return display_name(); }
virtual GameObjectClasses get_class_types() const override { return BadGuy::get_class_types().add(typeid(Mole)); }

virtual bool is_snipable() const override { return true; }

Expand Down
1 change: 0 additions & 1 deletion src/badguy/mole_rock.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ class MoleRock final : public BadGuy
virtual std::string get_class_name() const override { return class_name(); }
static std::string display_name() { return _("Mole's rock"); }
virtual std::string get_display_name() const override { return display_name(); }
virtual GameObjectClasses get_class_types() const override { return BadGuy::get_class_types().add(typeid(MoleRock)); }

protected:
const BadGuy* parent; /**< collisions with this BadGuy will be ignored */
Expand Down
1 change: 0 additions & 1 deletion src/badguy/mrbomb.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ class MrBomb final : public WalkingBadguy
virtual std::string get_class_name() const override { return class_name(); }
static std::string display_name() { return _("Mr. Bomb"); }
virtual std::string get_display_name() const override { return display_name(); }
virtual GameObjectClasses get_class_types() const override { return WalkingBadguy::get_class_types().add(typeid(MrBomb)); }
virtual bool is_snipable() const override { return true; }

GameObjectTypes get_types() const override;
Expand Down
1 change: 0 additions & 1 deletion src/badguy/mriceblock.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ class MrIceBlock : public WalkingBadguy
virtual std::string get_class_name() const override { return class_name(); }
static std::string display_name() { return _("Mr. Iceblock"); }
virtual std::string get_display_name() const override { return display_name(); }
virtual GameObjectClasses get_class_types() const override { return WalkingBadguy::get_class_types().add(typeid(MrIceBlock)); }

virtual bool is_snipable() const override { return ice_state != ICESTATE_KICKED; }
virtual bool is_freezable() const override;
Expand Down
1 change: 0 additions & 1 deletion src/badguy/mrtree.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ class MrTree final : public WalkingBadguy
virtual std::string get_class_name() const override { return class_name(); }
static std::string display_name() { return _("Mr. Tree"); }
virtual std::string get_display_name() const override { return display_name(); }
virtual GameObjectClasses get_class_types() const override { return WalkingBadguy::get_class_types().add(typeid(MrTree)); }

GameObjectTypes get_types() const override;
std::string get_default_sprite_name() const override;
Expand Down
Loading

0 comments on commit 15a29c6

Please sign in to comment.