forked from yogykwan/design-patterns-cpp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathadapter.h
More file actions
61 lines (49 loc) · 884 Bytes
/
adapter.h
File metadata and controls
61 lines (49 loc) · 884 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
//
// Created by Jennica on 2016/12/29.
//
#ifndef DESIGN_PATTERNS_ADAPTER_H
#define DESIGN_PATTERNS_ADAPTER_H
#include <string>
class Player {
public:
Player() {}
Player(std::string);
virtual void Attack() {}
virtual void Defense() {}
protected:
std::string name_;
};
class Forward: public Player {
public:
Forward() {}
Forward(std::string);
void Attack();
void Defense();
};
class Center: public Player {
public:
Center() {}
Center(std::string);
void Attack();
void Defense();
};
class ForeignCenter {
public:
ForeignCenter() {}
ForeignCenter(std::string);
void Gong();
void Shou();
private:
std::string name_;
};
class Translator: public Player {
public:
Translator() {}
Translator(std::string);
~Translator();
void Attack();
void Defense();
private:
ForeignCenter *foreign_center_;
};
#endif //DESIGN_PATTERNS_ADAPTER_H