Pella86

Piece.h

Jan 11th, 2012
182
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.74 KB | None | 0 0
  1. #ifndef PIECE_H
  2. #define PIECE_H
  3.  
  4. #include <iostream>
  5. #include <map>
  6. #include <string>
  7.  
  8. #define DEBUG
  9.  
  10. #define PRINTVAR(VAR) \
  11. std::cerr << "DEBUG "<< #VAR << ": "<< VAR << " at line: " << __LINE__<< " in file: "<< __FILE__ <<std::endl
  12.  
  13. enum PiecesID {
  14.     NONE = 0,
  15.     PAWN,
  16.     KNIGHT,
  17.     BISHOP,
  18.     ROOK,
  19.     KING,
  20.     QUEEN,
  21. };
  22.  
  23. enum ColorID {
  24.     colNONE = 0,
  25.     BLACK,
  26.     WHITE
  27. };
  28.  
  29. class Piece {
  30. private:
  31.     PiecesID idPiece;
  32.     ColorID color;
  33. public:
  34.     Piece():idPiece(NONE), color(colNONE){}
  35.     Piece(PiecesID pid, ColorID cid):idPiece(pid),color(cid){}
  36.    
  37.     PiecesID const& getId() const {return idPiece;}
  38.     PiecesID& setId() {return idPiece;}
  39.    
  40.     ColorID const& getColor() const {return color;}
  41.     ColorID & setColor(){return color;}
  42.    
  43. };
  44.  
  45. #endif
Advertisement
Add Comment
Please, Sign In to add comment