From 583ec3285c41e9d253c4aaabd2af4dadac75f3a7 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Sun, 23 Nov 2008 12:34:07 +0000 Subject: clean module consturction/destruction --- src/game/intro/intro.cc | 14 ++++++-------- src/game/intro/intro.h | 17 +++++++---------- 2 files changed, 13 insertions(+), 18 deletions(-) (limited to 'src/game/intro') diff --git a/src/game/intro/intro.cc b/src/game/intro/intro.cc index efb3b40..ed512ca 100644 --- a/src/game/intro/intro.cc +++ b/src/game/intro/intro.cc @@ -14,18 +14,16 @@ namespace intro { -Intro::Intro() : core::Module("intro", "Introduction", false) +core::Module *factory() { - intro_zone = 0; - intro_convoy = 0; + return new Intro(); } -Intro::~Intro() +Intro::Intro() : core::Module("Introduction", false) { -} + intro_zone = 0; + intro_convoy = 0; -void Intro::init() -{ /// intialize a single zone for the introduction intro_zone = new core::Zone("intro"); intro_zone->set_name("Introduction"); @@ -144,7 +142,7 @@ void Intro::frame(float seconds) } } -void Intro::shutdown() +Intro::~Intro() { intro_zone = 0; diff --git a/src/game/intro/intro.h b/src/game/intro/intro.h index da6fb80..d94b1f5 100644 --- a/src/game/intro/intro.h +++ b/src/game/intro/intro.h @@ -21,23 +21,17 @@ public: /// create an introduction game module Intro(); /// delete an introduction game module - ~Intro(); + virtual ~Intro(); /// run one frame - void frame(float seconds); + virtual void frame(float seconds); /// is called when a player connects - void player_connect(core::Player *player); + virtual void player_connect(core::Player *player); /// is called when a player disconnects - void player_disconnect(core::Player *player); + virtual void player_disconnect(core::Player *player); -protected: - /// run the introduction - void init(); - - /// shutdown the introduction - void shutdown(); private: core::Zone *intro_zone; Convoy *intro_convoy; @@ -45,6 +39,9 @@ private: bool load_world(); }; +/// factory function +core::Module *factory(); + } #endif // __INCLUDED_INTRO_H__ -- cgit v1.2.3