ekku@197: #ifndef PROJECTILE_HH ekku@197: #define PROJECTILE_HH ekku@197: terom@201: class Projectile; ekku@197: ekku@222: #include "GameState.hh" ekku@197: #include "PhysicsObject.hh" saiam@208: #include "Timer.hh" terom@233: #include "GraphicsPointer.hh" ekku@197: terom@201: class Projectile : public PhysicsObject { ekku@197: protected: ekku@197: GameState &state; ekku@197: bool visible; ekku@197: bool target_visible; saiam@208: float radius; terom@223: ekku@197: public: saiam@208: TickCount birth_tick; saiam@208: TickCount age; saiam@208: terom@223: Projectile (GameState &state, Vector position, Vector velocity, bool visible, float radius, TickCount age=1000000000); ekku@222: virtual ~Projectile (void); ekku@197: terom@233: virtual void draw (Graphics *g) const; ekku@222: ekku@222: protected: terom@224: /* terom@224: * Removes ground at given position if applicable, and destroys this PhysicsObject. terom@224: * terom@224: * This is overriden by Network. terom@224: */ terom@224: virtual void onDestroy (Vector position, bool removeGround); terom@224: terom@224: /* terom@224: * Call onDestroy, removingGround terom@224: */ ekku@222: virtual void onCollision (void); terom@224: terom@224: /* terom@224: * If we have expired, call onDestory without removingGround terom@224: */ ekku@222: virtual void tick (TimeMS dt); ekku@197: }; ekku@197: ekku@197: #endif