2012-09-09 20:50:15 +00:00
|
|
|
/*
|
|
|
|
* Bullet.h
|
|
|
|
*
|
|
|
|
* Created on: 12.08.2012
|
|
|
|
* Author: Felix
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef DG_BULLET_H_
|
|
|
|
#define DG_BULLET_H_
|
|
|
|
|
|
|
|
#include "../particle/Particle.h"
|
2012-10-12 17:22:53 +00:00
|
|
|
#include "../util/String.h"
|
|
|
|
#include "../util/Yaml.h"
|
2012-09-09 20:50:15 +00:00
|
|
|
|
2012-09-14 18:39:56 +00:00
|
|
|
class Particle;
|
2012-10-12 17:22:53 +00:00
|
|
|
class Yaml;
|
2012-09-14 18:39:56 +00:00
|
|
|
|
2012-09-09 20:50:15 +00:00
|
|
|
/**
|
|
|
|
* Bullet particle fired by a weapon, may damage actors.
|
|
|
|
*/
|
|
|
|
class Bullet : public Particle {
|
|
|
|
// Public functions.
|
|
|
|
public:
|
2012-10-12 17:22:53 +00:00
|
|
|
Bullet(const Vector2f& position, b2World& world, Physical& shooter, float direction,
|
|
|
|
const Yaml& config);
|
2012-09-09 20:50:15 +00:00
|
|
|
|
|
|
|
void onCollide(Physical& other, uint16 category);
|
|
|
|
bool doesCollide(Physical& other);
|
2012-09-12 12:21:57 +00:00
|
|
|
|
2012-09-11 17:20:17 +00:00
|
|
|
// Public variables.
|
|
|
|
public:
|
|
|
|
static const Vector2i SIZE;
|
2012-09-09 20:50:15 +00:00
|
|
|
|
2012-09-09 20:50:15 +00:00
|
|
|
// Private variables.
|
|
|
|
private:
|
2012-10-12 17:22:53 +00:00
|
|
|
static const String KEY_DAMAGE;
|
|
|
|
static const String KEY_SPEED;
|
|
|
|
|
2012-09-09 20:50:15 +00:00
|
|
|
Physical& mShooter;
|
2012-10-12 17:22:53 +00:00
|
|
|
const int mDamage;
|
|
|
|
const float mSpeed;
|
2012-09-09 20:50:15 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* DG_BULLET_H_ */
|