-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathweapon.h
More file actions
43 lines (35 loc) · 882 Bytes
/
weapon.h
File metadata and controls
43 lines (35 loc) · 882 Bytes
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
37
38
39
40
41
42
43
/*
* Copyright (c) 2014 Ross Simpson
* All Right Reserved
*
* This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
* To view a copy of this license,visit http://creativecommons.org/licenses/by-nc-sa/4.0/.
*/
#ifndef WEAPON_H
#define WEAPON_H
#include <vector>
#include "object.h"
class Weapon
{
public:
Weapon() {}
virtual ~Weapon() {}
virtual void update() = 0;
virtual void fire(Vector2D shipPosition) = 0;
virtual bool init() = 0;
virtual void render(SDL_Renderer *renderer) = 0;
};
class StandardLaserWeapon : public Weapon
{
private:
SDL_Texture *bulletTexture;
std::vector<Vector2D*> bullets;
public:
StandardLaserWeapon() {}
~StandardLaserWeapon();
bool init();
void update();
void render(SDL_Renderer *renderer);
void fire(Vector2D shipPosition);
};
#endif // WEAPON_H