File tree Expand file tree Collapse file tree 3 files changed +23
-12
lines changed Expand file tree Collapse file tree 3 files changed +23
-12
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ project(SHM)
10
10
11
11
# set executables
12
12
set (THIS_PROJECT_SRC_DIRECTORIES
13
+ source /Island.cpp
13
14
source /Fortune.cpp
14
15
source /Map.cpp
15
16
source /Game.cpp
Original file line number Diff line number Diff line change
1
+ #include " Island.hpp"
2
+
3
+ Island::Coordinates::Coordinates (const int x, const int y):
4
+ positionX(x),
5
+ positionY(y)
6
+ {}
7
+
8
+ bool Island::Coordinates::operator ==(const Coordinates& coordinates) {
9
+ return (positionX == coordinates.positionX && positionY == coordinates.positionY );
10
+ }
11
+
12
+ Island::Island (const Coordinates& coordinates):
13
+ position_(coordinates)
14
+ {}
15
+
16
+ Island::Coordinates Island::getPosition () const {
17
+ return position_;
18
+ }
Original file line number Diff line number Diff line change @@ -5,22 +5,14 @@ struct Island {
5
5
int positionX;
6
6
int positionY;
7
7
8
- Coordinates (const int x, const int y):
9
- positionX (x),
10
- positionY (y)
11
- {}
8
+ Coordinates (const int x, const int y);
12
9
13
- bool operator ==(const Coordinates& coordinates) {
14
- return (positionX == coordinates.positionX && positionY == coordinates.positionY );
15
- }
10
+ bool operator ==(const Coordinates& coordinates);
16
11
};
17
12
18
- public:
19
- Island (const Coordinates& coordinates):
20
- position_ (coordinates)
21
- {}
13
+ Island (const Coordinates& coordinates);
22
14
23
- Coordinates getPosition () const { return position_; }
15
+ Coordinates getPosition () const ;
24
16
25
17
private:
26
18
Coordinates position_;
You can’t perform that action at this time.
0 commit comments