1 /*************************************************************************** 2 renderedprojectile.h - Class representing a projectile 3 ------------------- 4 begin : Sat May 3 2003 5 copyright : (C) 2003 by Gabor Torok 6 email : cctorok@yahoo.com 7 ***************************************************************************/ 8 9 /*************************************************************************** 10 * * 11 * This program is free software; you can redistribute it and/or modify * 12 * it under the terms of the GNU General Public License as published by * 13 * the Free Software Foundation; either version 2 of the License, or * 14 * (at your option) any later version. * 15 * * 16 ***************************************************************************/ 17 18 #ifndef RENDERED_PROJECTILE_H 19 #define RENDERED_PROJECTILE_H 20 #pragma once 21 22 #include <map> 23 #include <vector> 24 #include "render.h" 25 26 /** 27 * @author Gabor Torok 28 * 29 */ 30 31 class RenderedCreature; 32 class ProjectileRenderer; 33 34 /// A projectile rendered on the map. 35 class RenderedProjectile { 36 protected: 37 static std::map<RenderedCreature*, std::vector<RenderedProjectile*>*> projectiles; 38 39 public: 40 RenderedProjectile(); 41 virtual ~RenderedProjectile(); 42 43 virtual int getStepCount() = 0; 44 virtual float getX( int index ) = 0; 45 virtual float getY( int index ) = 0; 46 virtual float getZ( int index ) = 0; 47 virtual float getCurrentX() = 0; 48 virtual float getCurrentY() = 0; 49 virtual float getCurrentZ() = 0; 50 virtual float getAngle() = 0; 51 virtual ProjectileRenderer *getRenderer() = 0; 52 virtual RenderedCreature *getCreature() = 0; 53 getProjectileMap()54 inline static std::map<RenderedCreature *, std::vector<RenderedProjectile*>*> *getProjectileMap() { 55 return &projectiles; 56 } 57 static void resetProjectiles(); 58 static void removeProjectile( RenderedProjectile *p ); 59 60 protected: 61 static void addProjectile( RenderedProjectile *proj ); 62 63 }; 64 65 #endif 66