00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #ifndef POWERUP_H_
00015 #define POWERUP_H_
00016
00017 #include "../Config.h"
00018 #include "GameDebug.h"
00019 #include "Player.h"
00020 #include "../Graphics/draw.h"
00021 #include "../Parse/ListParser.h"
00022
00023 namespace Game {
00024
00028 class Powerup : public Graphics::DrawableAt {
00029 public:
00030 virtual void effect(AbstractPlayer* p)=0;
00031 virtual ~Powerup() {}
00032 };
00033
00037 class Powerup_impl : public Powerup {
00038 public:
00042 Powerup_impl(Graphics::DrawableAt* pic);
00043
00044 ~Powerup_impl();
00045 protected:
00047 void drawAt(SDL_Surface* surf, SDL_Rect* r);
00048 private:
00049 Graphics::DrawableAt* pic;
00050 };
00051
00053 class SpeedUp : public Powerup_impl {
00054 public:
00055 SpeedUp();
00056 void effect(AbstractPlayer* p);
00057 };
00058
00060 class IncreaseBombRadius : public Powerup_impl {
00061 public:
00062 IncreaseBombRadius();
00063 void effect(AbstractPlayer* p);
00064 };
00065
00067 class IncreaseBombCount : public Powerup_impl {
00068 public:
00069 IncreaseBombCount();
00070 void effect(AbstractPlayer *p);
00071 };
00072
00076 class PowerupFactory : public Parse::Parseable {
00077 public:
00078 PowerupFactory();
00083 Powerup* getPowerup();
00084
00093 Parse::Parser* makeParserToParseMe(std::istream& in);
00094 private:
00095 float incBombCountProb;
00096 float incBombRadProb;
00097 float speedUpProb;
00098 };
00099 };
00100
00101 #endif // ifndef POWERUP_H_