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/items/Weapon.h

56 lines
1 KiB
C
Raw Normal View History

/*
* Weapon.h
*
* Created on: 12.08.2012
* Author: Felix
*/
#ifndef DG_WEAPON_H_
#define DG_WEAPON_H_
#include <Thor/Particles.hpp>
#include "../abstract/Physical.h"
#include "../particle/Emitter.h"
2012-10-14 16:14:06 +00:00
#include "../types/Instances.h"
#include "../util/Timer.h"
#include "../util/Yaml.h"
class Emitter;
class Instances;
class Physical;
class Timer;
2012-10-12 17:22:53 +00:00
class Yaml;
/**
* Loading mechanism:
* - pass enum value and load mapped xml
* - pass xml filename
*/
2012-09-12 12:21:57 +00:00
class Weapon : public Emitter {
2012-09-11 19:13:36 +00:00
// Public functions.
public:
Weapon(const Instances& instances, Physical& holder, const Yaml& config);
void fire();
2012-09-12 12:21:57 +00:00
2012-09-11 19:13:36 +00:00
// Protected functions.
protected:
std::shared_ptr<Particle> createParticle();
2012-09-11 19:13:36 +00:00
// Private variables.
private:
2012-10-12 17:22:53 +00:00
static const String KEY_BULLET;
static const String KEY_INTERVAL;
2012-09-11 19:15:16 +00:00
Physical& mHolder;
b2World& mWorld;
Vector2f mOffset; //< Offset to the point where bullets are inserted (from holder center).
const String mBullet;
Timer mTimer;
};
#endif /* DG_WEAPON_H_ */