Website Summary Files Commits Branches @commit @diff @stats
path: root / DiamondProblemAndPolymorphism / Chess / Figure.hpp
diff options
context:
space:
mode:
Commit112a0d344da9e66d20ee9ab5d488e59c5d52e6ad (patch)
Author
 Angeld55 <angel_dimitriev@abv.bg>
2020-04-09 18:09:42 +0300
Committer
 Angeld55 <angel_dimitriev@abv.bg>
2020-04-09 18:09:42 +0300
Filese3bb9cf17c24a3b53c746d9142906d550d549465 /DiamondProblemAndPolymorphism/Chess/Figure.hpp
Object-oriented_programming_FMI-112a0d344da9e66d20ee9ab5d488e59c5d52e6ad.tar
Object-oriented_programming_FMI-112a0d344da9e66d20ee9ab5d488e59c5d52e6ad.tar.gz
Object-oriented_programming_FMI-112a0d344da9e66d20ee9ab5d488e59c5d52e6ad.zip
Parentec26fab32d144b436d08f9da6049bd053156d783 (diff)
added new examples
1 files changed, 0 insertions, 35 deletions
-rw-r--r--DiamondProblemAndPolymorphism/Chess/Figure.hpp35
diff --git a/DiamondProblemAndPolymorphism/Chess/Figure.hpp b/DiamondProblemAndPolymorphism/Chess/Figure.hpp
deleted file mode 100644
index 2d3e73e..0000000
--- a/DiamondProblemAndPolymorphism/Chess/Figure.hpp
+++ /dev/null
@@ -1,35 +0,0 @@
-#pragma once
-#include <iostream>
-
-using namespace std;
-
-bool isValidCoord(int xCoord, int yCoord)
-{
- return xCoord >= 0 && xCoord <= 7
- && yCoord >= 0 && yCoord <= 7;
-}
-
-class Figure
-{
-public:
- Figure(int xCoord, int yCoord, bool isWhite);
-
- int xCoord;
- int yCoord;
- bool isWhite;
- virtual bool Move(int xCoord, int yCoord) = 0;
- virtual void Print() = 0;
- virtual ~Figure(){};
-};
-
-Figure::Figure(int xCoord, int yCoord, bool isWhite)
-{
- if (isValidCoord(xCoord, yCoord))
- {
- this->xCoord = xCoord;
- this->yCoord = yCoord;
- this->isWhite = isWhite;
- }
- else
- throw "Ivalid coordinates";
-} \ No newline at end of file