Website Summary Files Commits Branches @commit @diff @stats
path: root / Sem. 15 / Chess / Figures / Knight / Knight.cpp
diff options
context:
space:
mode:
Commit9a86536fb579b244b29aa03fbefcce54746546dc (patch)
Author
 angeld55 <angel_dimitriev@abv.bg>
2021-06-12 19:02:26 +0300
Committer
 angeld55 <angel_dimitriev@abv.bg>
2021-06-12 19:02:26 +0300
Filescf5bce7cce7c692b111ac441e688f43b658f5bd3 /Sem. 15/Chess/Figures/Knight/Knight.cpp
Object-oriented_programming_FMI-9a86536fb579b244b29aa03fbefcce54746546dc.tar
Object-oriented_programming_FMI-9a86536fb579b244b29aa03fbefcce54746546dc.tar.gz
Object-oriented_programming_FMI-9a86536fb579b244b29aa03fbefcce54746546dc.zip
Parent9603d0847a01c555c2c9286294b3ccdea3e38be8 (diff)
fixes
1 files changed, 0 insertions, 26 deletions
-rw-r--r--Sem. 15/Chess/Figures/Knight/Knight.cpp26
diff --git a/Sem. 15/Chess/Figures/Knight/Knight.cpp b/Sem. 15/Chess/Figures/Knight/Knight.cpp
deleted file mode 100644
index 5713d7c..0000000
--- a/Sem. 15/Chess/Figures/Knight/Knight.cpp
+++ /dev/null
@@ -1,26 +0,0 @@
-#include "Knight.h"
-#include <cmath>
-
-Knight::Knight(bool isWhite) : Figure(isWhite, KnightFigure)
-{}
-bool Knight::canBeMoved(size_t currentX, size_t currentY, size_t destX, size_t destY) const
-{
- int xMovеment[] = { 1, 1, -1, -1, 2, -2, 2, -2 };
- int yMovеment[] = { 2, -2, 2, -2, 1, 1, -1, -1 };
-
- for (int i = 0; i < 8; i++)
- {
- if (currentX + xMovеment[i] == destX &&
- currentY + yMovеment[i] == destY)
- return true;
- }
- return false;
-}
-
-void Knight::print() const
-{
- if (getIsWhite())
- std::cout << 'K';
- else
- std::cout << 'k';
-} \ No newline at end of file