Danbias/Code/Game/GameLogic/PickupSystem/Pickup.h

35 lines
837 B
C
Raw Permalink Normal View History

2014-02-25 14:36:54 +01:00
#ifndef PICKUP_H
#define PICKUP_H
#include "../StaticObject.h"
#include "../Player.h"
#include "WinTimer.h"
typedef void (*EventOnCollision)(Oyster::Physics::ICustomBody *proto,Oyster::Physics::ICustomBody *deuter,Oyster::Math::Float kineticEnergyLoss);
namespace GameLogic
{
class Pickup : public StaticObject
{
public:
Pickup(Oyster::Physics::ICustomBody *rigidBody, EventOnCollision collisionFunc, ObjectSpecialType type, int objectID, Oyster::Math::Float spawnTime);
virtual ~Pickup();
virtual void Update();
bool IsActive();
virtual void OnCollision(Player *player) = 0;
static void PickupCollision(Oyster::Physics::ICustomBody *rigidBodyCrate, Oyster::Physics::ICustomBody *obj, Oyster::Math::Float kineticEnergyLoss);
protected:
bool active;
Utility::WinTimer timer;
double spawnTime;
};
}
#endif