-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclasses.h
More file actions
63 lines (57 loc) · 1.33 KB
/
classes.h
File metadata and controls
63 lines (57 loc) · 1.33 KB
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
#ifndef CLASSES_H
#define CLASSES_H
#include <string>
#include <iostream>
class ship
{
public:
std::string ship_class;
int hp;
int armor;
int firepower;
int armor_penetration;
int gun_range;
int reload_time;
int time_to_reload;
int accuracy;
int dodging_target_hit_chance;
int speed;
int moves_left_in_turn;
int dodge_chance;
int certain_detection_range;
int uncertain_detection_range;
int position_x;
int position_y;
int destination_x;
int destination_y;
int cost;
//ship type functions
void battleship(int num);
void cruiser(int num);
void destroyer(int num);
void carrier(int num);
void print_detailed_ship_info();
void print_short_ship_info();
// ship constructor
ship(int type, int num)
{
switch (type)
{
case 0:
destroyer(num);
break;
case 1:
cruiser(num);
break;
case 2:
battleship(num);
break;
case 3:
carrier(num);
break;
default:
break;
}
}
};
#endif