-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathShip.cpp
107 lines (87 loc) · 2.17 KB
/
Ship.cpp
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* Ship.cpp :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: cdeniau <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2015/11/08 12:19:28 by cdeniau #+# #+# */
/* Updated: 2015/11/08 16:34:18 by cdeniau ### ########.fr */
/* */
/* ************************************************************************** */
#include "ft_retro.hpp"
Ship::Ship(void){
setW(0);
setH(0);
setHp(1);
setScore(0);
setFlag(0);
return ;
}
Ship::Ship(unsigned int w, unsigned int h, unsigned int hp, unsigned int score, unsigned int flag) {
setW(w);
setH(h);
setHp(hp);
setScore(score);
setFlag(flag);
return ;
}
Ship::~Ship(void){
}
unsigned int Ship::getW(void) const{
return _w;
}
unsigned int Ship::getH(void) const{
return _h;
}
unsigned int Ship::getHp(void) const{
return _hp;
}
unsigned int Ship::getScore(void) const{
return _score;
}
unsigned int Ship::getFlag(void) const{
return _bulletFlag;
}
void Ship::setW(unsigned int w){
_w = w;
return ;
}
void Ship::setScore(unsigned int score){
_score = score;
return ;
}
void Ship::setFlag(unsigned int flag){
_bulletFlag = flag;
return ;
}
void Ship::setH(unsigned int h){
_h = h;
return ;
}
void Ship::setHp(unsigned int hp){
_hp = hp;
return ;
}
void Ship::move(unsigned int w, unsigned int h) {
setW(w);
setH(h);
return ;
}
Ship &Ship::operator=(Ship const & rhs){
setW(rhs.getW());
setH(rhs.getH());
return *this;
}
Ship::Ship(Ship const & src){
*this = src;
return ;
}
/*
void Ship::setMap(Map *map){
_map = map;
return;
}
std::ostream & operator<<(std::ostream & o, Ship const & rhs){
return o;
}*/