-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merging Client changes with Coordinate.h
- Loading branch information
Showing
4 changed files
with
70 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#ifndef COORDINATE_H | ||
#define COORDINATE_H | ||
|
||
#include <string> | ||
|
||
class Coordinate | ||
{ | ||
private: | ||
int m_x; | ||
int m_y; | ||
|
||
public: | ||
Coordinate(int x, int y) : m_x(x), m_y(y) {}; | ||
int getX() const { return m_x; } | ||
int getY() const { return m_y; } | ||
|
||
std::string toString() const; | ||
}; | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#include <string> | ||
#include "Coordinate.h" | ||
|
||
std::string Coordinate::toString() const | ||
{ | ||
return "(" + std::to_string(getX()) + ":" + std::to_string(getY()) + ")"; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters