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
Felix Ableitner 11da25ce69 Minor code changes.
Moved template function definitions out of class definitions.
Moved Instances to util/.
2012-10-13 13:13:19 +02:00

50 lines
957 B
C++
Executable file

/*
* Weapon.h
*
* Created on: 12.08.2012
* Author: Felix
*/
#ifndef DG_WEAPON_H_
#define DG_WEAPON_H_
#include <Thor/Particles.hpp>
#include "../util/Instances.h"
#include "../abstract/Physical.h"
#include "../particle/Emitter.h"
#include "../util/Yaml.h"
class Emitter;
class Instances;
class Physical;
class Yaml;
/**
* Loading mechanism:
* - pass enum value and load mapped xml
* - pass xml filename
*/
class Weapon : public Emitter {
// Public functions.
public:
Weapon(const Instances& instances, Physical& holder, const Yaml& config);
void fire();
// Protected functions.
protected:
std::shared_ptr<Particle> createParticle();
// Private variables.
private:
static const String KEY_BULLET;
Physical& mHolder;
b2World& mWorld;
Vector2f mOffset; //< Offset to the point where bullets are inserted (from holder center).
const String mBullet;
};
#endif /* DG_WEAPON_H_ */