home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The C Users' Group Library 1994 August
/
wc-cdrom-cusersgrouplibrary-1994-08.iso
/
listings
/
v_10_10
/
1010111a
< prev
next >
Wrap
Text File
|
1992-08-10
|
1KB
|
51 lines
#ifndef GAME_H
#define GAME_H
class game_piece {
public:
virtual void position (); // notice the keyword virtual
virtual void move (); // preceeding these member functions.
private:
int x_coord;
int y_coord;
};
class pawn : public game_piece {
public:
pawn ();
~pawn ();
void position (); // derived class implementations of
void move (); // base class virtual functions.
};
class bishop : public game_piece {
public:
bishop ();
~bishop ();
void position (); // derived class implementations of
void move (); // base class virtual functions.
};
class rook : public game_piece {
public:
rook ();
~rook ();
void position (); // derived class implementations of
void move (); // base class virtual functions.
};
class king : public game_piece {
public:
king ();
~king ();
void position (); // derived class implementations of
void move (); // base class virtual functions.
};
#endif // GAME_H