-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMissile.h
66 lines (57 loc) · 1.89 KB
/
CMissile.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
/**
* @file CMissile.h
* @brief Declaration of the CMissile class.
*
* This file contains the declaration of the CMissile class, which represents a missile object in the game.
* It extends the CGameObject class and adds functionality specific to missiles.
*
* @author Faniel Yemane
*/
#pragma once
#include "CGameObject.h"
/**
* @class CMissile
* @brief A class representing a missile object in the game.
*
* This class extends the CGameObject class and adds functionality specific to missiles.
*/
class CMissile : public CGameObject {
private:
int m_thrust; ///< The thrust of the missile.
int m_maxFuel; ///< The maximum fuel capacity of the missile.
int m_fuel; ///< The remaining fuel of the missile.
public:
/**
* @brief Constructor for CMissile.
* @param position The position of the missile.
* @param shape The shape of the missile.
* @param color The color of the missile.
*/
CMissile(cv::Point2f position, std::string shape, std::string color);
/**
* @brief Destructor for CMissile.
*/
~CMissile();
/**
* @brief Function to fire the missile.
* @param player_position The position of the player.
* @param player_angle The angle of the player.
* @param player_velocity The velocity of the player.
* @param canvasSize The size of the canvas.
*/
void fire(cv::Point player_position, double player_angle, cv::Point player_velocity, cv::Rect& canvasSize);
/**
* @brief Function to update the state of the missile.
* @param canvasSize The size of the canvas.
*/
void update(cv::Rect& canvasSize) override;
/**
* @brief Function to reset the missile.
*/
void reset();
/**
* @brief Function to draw the missile on the canvas.
* @param canvas The canvas to draw on.
*/
void draw(cv::Mat& canvas) override;
};