• Main Page
  • Classes
  • Files
  • File List
  • File Members

code/include/powerups/PowerupSpeedUp.h

Go to the documentation of this file.
00001 /*
00002  * TetriCycle
00003  * Copyright (C) 2010 Cale Scholl
00004  *
00005  * This file is part of TetriCycle.
00006  *
00007  * TetriCycle is free software: you can redistribute it and/or modify
00008  * it under the terms of the GNU Lesser General Public License as published
00009  * by the Free Software Foundation, either version 3 of the License, or
00010  * (at your option) any later version.
00011  *
00012  * TetriCycle is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  * GNU Lesser General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU Lesser General Public License
00018  * along with TetriCycle.  If not, see <http://www.gnu.org/licenses/>.
00019  */
00020 
00021 /** @file PowerupSpeedUp.h
00022  * @author Cale Scholl
00023  *
00024  * @page poweruplistpage Powerup List
00025  *
00026  * @section PowerupSpeedUp
00027  * A powerup that temporarily increases the level (speed) of the target player.
00028  */
00029 
00030 #pragma once
00031 #ifndef __POWERUPSPEEDUP_H__
00032 #define __POWERUPSPEEDUP_H__
00033 
00034 #include "Powerup.h"
00035 
00036 /// A powerup that temporarily increases the level (speed) of the target player.
00037 class PowerupSpeedUp : public Powerup
00038 {
00039 public:
00040   virtual PowerupId GetPowerupId() { return powerupId; }
00041   virtual GuiImageData* GetImageData() { return imageData; }
00042   virtual string* GetHelpText() { return helpText; }
00043   // OPTIONAL: virtual GuiSound* GetSound() { return sound; }
00044 
00045 protected:
00046   PowerupSpeedUp()
00047   {
00048     STATIC
00049     (
00050       vector<Powerup *> &powerupVector = Powerup::GetVector();
00051       powerupId = powerupVector.size();
00052       powerupVector.push_back(this);
00053     )
00054   }
00055   virtual ~PowerupSpeedUp() { }
00056 
00057   /// Returns a new powerup instance.
00058   virtual Powerup* GetInstance() { return new PowerupSpeedUp(); }
00059 
00060   virtual void StartEffect(u8 player);
00061   virtual void StopEffect(u8 player);
00062   // OPTIONAL: (override if necessary)
00063   //virtual u32 GetDuration() { // TODO }
00064   //virtual PowerupTarget GetTargetType() { // TODO }
00065 
00066 private:
00067   static PowerupId powerupId;
00068   static Powerup *instance;
00069   static GuiImageData *imageData;
00070   static string helpText[2];
00071   // OPTIONAL: static GuiSound *sound;
00072 };
00073 
00074 #endif // __POWERUPSPEEDUP_H__

Generated on Wed Oct 20 2010 17:06:58 for TetriCycle by  doxygen 1.7.1