Rename the "BombFish" class to "SkyDive". The factory now uses the string "skydive".
authorFlorian Forster <supertux@octo.it>
Tue, 9 Mar 2010 12:38:29 +0000 (12:38 +0000)
committerFlorian Forster <supertux@octo.it>
Tue, 9 Mar 2010 12:38:29 +0000 (12:38 +0000)
SVN-Revision: 6583

src/badguy/owl.cpp
src/badguy/skydive.cpp
src/badguy/skydive.hpp
src/supertux/object_factory.cpp

index 011a527..152def3 100644 (file)
@@ -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);
index 8c38d6e..464bfd1 100644 (file)
 #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<Player *> (&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;
index b9a988b..d578b1c 100644 (file)
 #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);
index 098f952..15a730e 100644 (file)
@@ -176,7 +176,6 @@ ObjectFactory::init_factories()
 {
   // badguys
   add_factory<AngryStone>("angrystone");
-  add_factory<BombFish>("bombfish");
   add_factory<BouncingSnowball>("bouncingsnowball");
   add_factory<CaptainSnowball>("captainsnowball");
   add_factory<Crystallo>("crystallo");
@@ -202,6 +201,7 @@ ObjectFactory::init_factories()
   add_factory<PoisonIvy>("poisonivy");
   add_factory<ShortFuse>("short_fuse");
   add_factory<SSpiky>("sspiky");
+  add_factory<SkyDive>("skydive");
   add_factory<SkullyHop>("skullyhop");
   add_factory<SmartBall>("smartball");
   add_factory<Snail>("snail");