From 112a0d344da9e66d20ee9ab5d488e59c5d52e6ad Mon Sep 17 00:00:00 2001 From: Angeld55 Date: Thu, 9 Apr 2020 18:09:42 +0300 Subject: added new examples --- DiamondProblemAndPolymorphism/Chess/Rook.hpp | 31 ---------------------------- 1 file changed, 31 deletions(-) delete mode 100644 DiamondProblemAndPolymorphism/Chess/Rook.hpp (limited to 'DiamondProblemAndPolymorphism/Chess/Rook.hpp') diff --git a/DiamondProblemAndPolymorphism/Chess/Rook.hpp b/DiamondProblemAndPolymorphism/Chess/Rook.hpp deleted file mode 100644 index d973870..0000000 --- a/DiamondProblemAndPolymorphism/Chess/Rook.hpp +++ /dev/null @@ -1,31 +0,0 @@ -#pragma once -#include "Figure.hpp" - -class Rook : virtual public Figure -{ - -public: - Rook(int xCoordinate, int yCoordinate, bool isWhite) :Figure(xCoordinate, yCoordinate, isWhite) - {} - - bool Move(int xNew, int yNew); - - void Print(); - -}; - -bool Rook::Move(int xNew, int yNew) -{ - if (!isValidCoord(xNew, yNew)) - return false; - if (!(xCoord == xNew ^ yCoord == yNew)) - return false; - xCoord = xNew; - yCoord = yNew; - return true; -} - -void Rook::Print() -{ - cout << 'R'; -} \ No newline at end of file -- cgit v1.3.1-23-gd82d