forked from Ak0s/zerda-exam-cpp-foundations
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAirCraft.cpp
More file actions
40 lines (33 loc) · 812 Bytes
/
AirCraft.cpp
File metadata and controls
40 lines (33 loc) · 812 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
/*
* AirCraft.cpp
*
* Created on: 2016. dec. 6.
* Author: Tecra_Z50
*/
using namespace std;
#include "AirCraft.h"
#include "ToString.h"
AirCraft::AirCraft() {
this->actual_ammo = 0;
this->damage = 0;
this->ammo_storage = 100;
}
string AirCraft::get_type() {
return aircraft_type;
}
unsigned int AirCraft::fight() {
damage = base_damage * actual_ammo;
actual_ammo = 0;
return damage;
}
unsigned int AirCraft::refill(int &ammo_storage) {
actual_ammo = max_ammo;
ammo_storage -= actual_ammo;
return ammo_storage;
}
string AirCraft::get_status() {
return "Type " + aircraft_type + ", Ammo: " + to_string(actual_ammo) + ", Base Damage: " + to_string(base_damage) +
", All Damage: " + to_string(damage);
}
AirCraft::~AirCraft() {
}