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

code/include/PowerupUtils.h

Go to the documentation of this file.
00001 /*
00002  * TetriCycle
00003  * Copyright (C) 2009, 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 PowerupUtils.h
00022  * @brief Defines the PowerupUtils class.
00023  * @author Cale Scholl / calvinss4
00024  */
00025 
00026 #pragma once
00027 #ifndef __POWERUPUTILS_H__
00028 #define __POWERUPUTILS_H__
00029 
00030 #include <string>
00031 #include "defines_Powerup.h"
00032 
00033 class Powerup;
00034 class Player;
00035 class GuiImageData;
00036 class GuiSound;
00037 
00038 using std::string;
00039 
00040 /// A utility class for the Powerup framework.
00041 class PowerupUtils
00042 {
00043 public:
00044   static Powerup* GetStaticInstance(PowerupId pid);    ///< Returns a static Powerup instance.
00045   static GuiImageData* GetImageData(PowerupId pid);    ///< Returns the powerup image data.
00046   static GuiSound* GetSound(PowerupId pid);            ///< Returns the powerup sound.
00047   static string* GetHelpText(PowerupId pid);           ///< Returns the powerup help text.
00048   static PowerupId GetNextId(Player &player);          ///< Get the PowerupId for the next piece.
00049   static PowerupId GetRandomId(Player *player = NULL); ///< Generates a random PowerupId.
00050   static int GetTotalPowerups();                       ///< Returns the total number of unique powerups.
00051   static void ResetPowerupStartTimes();                ///< Called when the game is unpaused.
00052   static void DeleteAllPowerups();                     ///< Called when the game is reset/quit.
00053 
00054   /// Sound effect for invalid use of Powerup.
00055   static GuiSound* GetInvalidTargetSound() { return invalidTargetSound; }
00056 
00057 private:
00058   PowerupUtils() { }
00059 
00060   static GuiSound *invalidTargetSound;
00061 };
00062 
00063 #endif // __POWERUPUTILS_H__

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