home *** CD-ROM | disk | FTP | other *** search
/ Collection of Hack-Phreak Scene Programs / cleanhpvac.zip / cleanhpvac / ARASAN_S.ZIP / EMOVE.H < prev    next >
C/C++ Source or Header  |  1994-02-19  |  1KB  |  63 lines

  1. // Copyright 1994 by Jon Dart.  All Rights Reserved.
  2.  
  3. #ifndef _EMOVE_H
  4. #define _EMOVE_H
  5.  
  6. #include "board.h"
  7. #include "move.h"
  8.  
  9. class ExtendedMove : public Move
  10. {
  11.     // "Extended move" class, allows fancier queries about a move,
  12.         // at the cost of some storage.    
  13.     
  14.     public:
  15.     
  16.     enum SpecialType { Normal, KCastle, QCastle, EnPassant, Promotion };
  17.     
  18.     ExtendedMove( const Board &ABoard, const Square start, 
  19.               const Square dest, 
  20.               const Piece::PieceType promotion = Piece::Invalid);
  21.           
  22.     ExtendedMove( const Board &ABoard, const Move &move );
  23.     
  24.     ExtendedMove();
  25.         
  26.     virtual ~ExtendedMove()
  27.     {
  28.     }
  29.     
  30.     const int operator == (const ExtendedMove &m) const;
  31.     // compares moves for equality.
  32.         
  33.     void MakeNull();
  34.     
  35.     const Piece &Capture() const
  36.     {
  37.         return my_capture;
  38.     }
  39.     
  40.     const Piece &PieceMoved() const
  41.     {
  42.         return my_piecemoved;
  43.     }
  44.     
  45.     const SpecialType Special() const; 
  46.     
  47.     const char *Image() const;
  48.     // returns a human-readable string.  CAUTION: reuses
  49.     // a static buffer for its return value.  This version
  50.     // returns a "better" image than the base class version.
  51.         
  52.         private:
  53.         
  54.     Piece my_piecemoved;
  55.     Piece my_capture;
  56.     byte my_special;
  57.                        
  58.         void set_special(const Board &ABoard);
  59. };
  60.  
  61. #endif
  62.  
  63.