From: florianf Date: Tue, 9 Mar 2010 12:38:29 +0000 (+0000) Subject: Rename the "BombFish" class to "SkyDive". The factory now uses the string "skydive". X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=72e5edc7bbf5abc24e375c7465938cff48581f75;p=supertux.git Rename the "BombFish" class to "SkyDive". The factory now uses the string "skydive". git-svn-id: http://supertux.lethargik.org/svn/supertux/trunk/supertux@6583 837edb03-e0f3-0310-88ca-d4d4e8b29345 --- diff --git a/src/badguy/owl.cpp b/src/badguy/owl.cpp index 011a52792..152def3d6 100644 --- a/src/badguy/owl.cpp +++ b/src/badguy/owl.cpp @@ -31,7 +31,7 @@ Owl::Owl(const Reader& reader) : BadGuy(reader, "images/creatures/owl/owl.sprite", LAYER_OBJECTS + 1), - carried_obj_name("bombfish"), + carried_obj_name("skydive"), carried_object(NULL) { reader.get("carry", carried_obj_name); @@ -40,7 +40,7 @@ Owl::Owl(const Reader& reader) : Owl::Owl(const Vector& pos, Direction d) : BadGuy(pos, d, "images/creatures/owl/owl.sprite", LAYER_OBJECTS + 1), - carried_obj_name("bombfish"), + carried_obj_name("skydive"), carried_object(NULL) { set_action (dir == LEFT ? "left" : "right", /* loops = */ -1); diff --git a/src/badguy/skydive.cpp b/src/badguy/skydive.cpp index 8c38d6eb1..464bfd1b3 100644 --- a/src/badguy/skydive.cpp +++ b/src/badguy/skydive.cpp @@ -22,20 +22,20 @@ #include "object/player.hpp" #include "object/explosion.hpp" -BombFish::BombFish(const Reader& reader) : +SkyDive::SkyDive(const Reader& reader) : BadGuy(reader, "images/creatures/bombfish/bombfish.sprite"), is_grabbed(false) { } -BombFish::BombFish(const Vector& pos, Direction d) : +SkyDive::SkyDive(const Vector& pos, Direction d) : BadGuy(pos, d, "images/creatures/bombfish/bombfish.sprite"), is_grabbed(false) { } void -BombFish::collision_solid(const CollisionHit& hit) +SkyDive::collision_solid(const CollisionHit& hit) { if (hit.bottom) { explode (); @@ -47,7 +47,7 @@ BombFish::collision_solid(const CollisionHit& hit) } /* void collision_solid */ HitResponse -BombFish::collision_badguy(BadGuy&, const CollisionHit& hit) +SkyDive::collision_badguy(BadGuy&, const CollisionHit& hit) { if (hit.bottom) { explode (); @@ -58,7 +58,7 @@ BombFish::collision_badguy(BadGuy&, const CollisionHit& hit) } /* HitResponse collision_badguy */ void -BombFish::grab (MovingObject&, const Vector& pos, Direction dir) +SkyDive::grab (MovingObject&, const Vector& pos, Direction dir) { movement = pos - get_pos(); this->dir = dir; @@ -73,7 +73,7 @@ BombFish::grab (MovingObject&, const Vector& pos, Direction dir) } void -BombFish::ungrab (MovingObject& , Direction) +SkyDive::ungrab (MovingObject& , Direction) { is_grabbed = false; @@ -84,7 +84,7 @@ BombFish::ungrab (MovingObject& , Direction) } HitResponse -BombFish::collision_player(Player&, const CollisionHit& hit) +SkyDive::collision_player(Player&, const CollisionHit& hit) { if (hit.bottom) { explode (); @@ -95,7 +95,7 @@ BombFish::collision_player(Player&, const CollisionHit& hit) } /* HitResponse collision_player */ bool -BombFish::collision_squished (GameObject& obj) +SkyDive::collision_squished (GameObject& obj) { Player *player = dynamic_cast (&obj); if (player) { @@ -108,14 +108,14 @@ BombFish::collision_squished (GameObject& obj) } /* bool collision_squished */ void -BombFish::active_update (float elapsed_time) +SkyDive::active_update (float elapsed_time) { if (!is_grabbed) movement = physic.get_movement(elapsed_time); } /* void active_update */ void -BombFish::explode (void) +SkyDive::explode (void) { if (!is_valid ()) return; diff --git a/src/badguy/skydive.hpp b/src/badguy/skydive.hpp index b9a988b19..d578b1cc0 100644 --- a/src/badguy/skydive.hpp +++ b/src/badguy/skydive.hpp @@ -20,14 +20,14 @@ #include "badguy/badguy.hpp" #include "object/portable.hpp" -class BombFish : public BadGuy, public Portable +class SkyDive : public BadGuy, public Portable { private: bool is_grabbed; public: - BombFish(const Reader& reader); - BombFish(const Vector& pos, Direction d); + SkyDive(const Reader& reader); + SkyDive(const Vector& pos, Direction d); void collision_solid(const CollisionHit& hit); HitResponse collision_badguy(BadGuy& badguy, const CollisionHit& hit); diff --git a/src/supertux/object_factory.cpp b/src/supertux/object_factory.cpp index 098f95264..15a730e73 100644 --- a/src/supertux/object_factory.cpp +++ b/src/supertux/object_factory.cpp @@ -176,7 +176,6 @@ ObjectFactory::init_factories() { // badguys add_factory("angrystone"); - add_factory("bombfish"); add_factory("bouncingsnowball"); add_factory("captainsnowball"); add_factory("crystallo"); @@ -202,6 +201,7 @@ ObjectFactory::init_factories() add_factory("poisonivy"); add_factory("short_fuse"); add_factory("sspiky"); + add_factory("skydive"); add_factory("skullyhop"); add_factory("smartball"); add_factory("snail");