-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathenemy.h
36 lines (32 loc) · 919 Bytes
/
enemy.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#ifndef ENEMY_H
#define ENEMY_H
#include "gameobject.h"
#include "animated.h"
#include "shot.h"
#include "route.h"
#include <QVector>
#include <QPoint>
#include <memory>
#include "shooter.h"
#include "physicalobject.h"
#include "routed.h"
class Enemy : public PhysicalObject, protected Animated, public Shooter
{
public:
enum class Type { Lobster, Fly, Wasp };
explicit Enemy(Enemy::Type type, QPoint start,double speed);
explicit Enemy();
virtual ~Enemy() override;
void move() final override;
void animate(Animation type) final override;
void makeFramesFromPixmap() final override;
void fire() final override;//
void draw(std::shared_ptr<QPainter> painter) final override;
void attack(std::shared_ptr<GameObject> player);
void read(const QJsonObject &json) final override;
void write(QJsonObject &json) const final override;
private:
Type type;
bool canAttack;
};
#endif // ENEMY_H