00001 /* This Spaceshooter is an small space adventure game 00002 * Copyright (C) 2006,2007 Steffen Nörtershäuser 00003 * Copyright (C) 2008 Christoph Egger 00004 * 00005 * This program is free software: you can redistribute it and/or modify 00006 * it under the terms of the GNU General Public License as published by 00007 * the Free Software Foundation, either version 3 of the License, or 00008 * (at your option) any later version. 00009 * 00010 * This program is distributed in the hope that it will be useful, 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00013 * GNU General Public License for more details. 00014 * 00015 * You should have received a copy of the GNU General Public License 00016 * along with this program. If not, see <http://www.gnu.org/licenses/>. 00017 */ 00018 00020 //PowerUp.h - Deklaration der Klasse CPowerUp 00021 //CPowerUp Klasse wird für das Verwalten von PowerUps benötigt 00022 //Steffen Nörtershäuser 00024 00025 00027 //Schutz vor Mehrfach Deklaration 00028 #ifndef POWERUP_H 00029 #define POWERUP_H 00030 00031 #include "CollisionSystem.hpp" 00032 #include "Singletons.hpp" 00033 00034 #include <string> 00035 00037 00041 class CPowerUp 00042 { 00043 public: 00045 CPowerUp(); 00046 ~CPowerUp(); 00047 00049 void Init(const std::string& FileName); 00050 00052 void SetPosition(float X, float Y) { m_Sprite.SetPosition(X,Y); } 00053 00055 std::string GetEquipWeapon() const { return m_EquipWeapon; } 00056 00058 int GetWeaponGroupID() const { return m_WeaponGroupInc; } 00059 00061 int GetRepair() const { return m_Repair; } 00062 00064 void Draw() 00065 { 00066 sgl::get_window().Draw(m_Sprite); 00067 m_CollisionSystem.SetPosition(m_Sprite.GetPosition().y,m_Sprite.GetPosition().y); 00068 m_CollisionSystem.Draw(); 00069 } 00070 00072 void Update(); 00073 00075 const CCollisionSystem* GetCollisionSystem() const { return &m_CollisionSystem; } 00076 private: 00077 sf::Sprite m_Sprite; //Das Sprite zum anzeigen des PowerUps 00078 CCollisionSystem m_CollisionSystem; //Das KollisionSystem 00079 00080 int m_LastFrameUpdate; //Die Millisekunden als die Frames des Sprites das letze mal Inkrementiert wurden 00081 int m_FrameDelay; //Wie lange zwischen dem aktualisiern der Frames gewartete wird 00082 00083 float m_Speed; //Die Geschwindigkeit des PowerUps 00084 00085 std::string m_EquipWeapon; //Die Waffe die beim Aufsammeln ausgerüstet wird 00086 int m_WeaponGroupInc;//Die WaffenGruppe mti der angeben ID wird inkrementiert 00087 int m_Repair; //Wie stark der Bonus das Schiff repariert 00088 }; 00089 00090 #endif