Hosting courtesy of Sourceforge

SourceForge Logo
Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

Powerup.h

Go to the documentation of this file.
00001 //
00002 //                                 Powerup.h
00003 //                             -------------------
00004 //    begin                : Thu Mar 7 2002
00005 //    copyright            : (C) 2002 by Rob Renaud
00006 //    email                : rrenaud@eden.rutgers.edu
00007 //
00008 //   This program is free software; you can redistribute it and/or modify
00009 //   it under the terms of the GNU General Public License as published by
00010 //   the Free Software Foundation; either version 2 of the License, or
00011 //   (at your option) any later version.
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_

Generated on Tue May 21 07:26:51 2002 for BomberLAN by doxygen1.2.12 written by Dimitri van Heesch, © 1997-2001