This repository has been archived on 2019-12-07. You can view files and clone it, but cannot push or open issues or pull requests.
dungeon-gunner/source/effects/Bullet.h

43 lines
842 B
C
Raw Normal View History

/*
* Bullet.h
*
* Created on: 12.08.2012
* Author: Felix
*/
#ifndef DG_BULLET_H_
#define DG_BULLET_H_
#include "../particle/Particle.h"
2012-10-14 16:14:06 +00:00
#include "../types/String.h"
2012-10-12 17:22:53 +00:00
#include "../util/Yaml.h"
class Particle;
2012-10-12 17:22:53 +00:00
class Yaml;
/**
* Bullet particle fired by a weapon, may damage actors.
*/
class Bullet : public Particle {
// Public functions.
public:
Bullet(const Vector2f& position, World& world, Body& shooter, float direction,
2012-10-12 17:22:53 +00:00
const Yaml& config);
void onCollide(Body& other, Category category);
bool doesCollide(Body& other);
// Private variables.
private:
2012-10-12 17:22:53 +00:00
static const String KEY_DAMAGE;
static const int DEFAULT_DAMAGE;
2012-10-12 17:22:53 +00:00
static const String KEY_SPEED;
static const float DEFAULT_SPEED;
2012-10-12 17:22:53 +00:00
Body& mShooter;
2012-10-12 17:22:53 +00:00
const int mDamage;
const float mSpeed;
};
#endif /* DG_BULLET_H_ */