-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathclasses.h
40 lines (34 loc) · 969 Bytes
/
classes.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
#pragma once
#include <string>
using namespace std;
class GameStructure { // create root class
public:
virtual void Help(); // virtual empty method
};
class Character : public GameStructure { // declare Character class, derived from GameStructure
private:
int Health;
public:
string Name;
int getHealth();
void setHealth(int health);
void defend(int hitPoints);
void Talk(string stuffToSay);
void Talk(string name, string stuffToSay);
virtual int Attack();
void Help(); // overriding help method
};
class Ninja : public Character { // declare Ninja class, derived from Character
public:
Ninja(string N, int H); // constructor
void ThrowStars(); // declare methods:
int Attack();
void Help();
};
class Pirate : public Character { // declare Pirate class, derived from Character
public:
Pirate(string N, int H); // constructor
void UseSword(); // declare methods:
int Attack();
void Help();
};