I have a project to make in C-builder. I have to make Chess. The problem is that I have to make it using CLASSES. Like, class Board, class Square, class Piece. I can't find any helpful links.
If someone knows how to make classes and to move random the pieces on the board please help me. I was thinking about something like that: class Pawn : public class Piece.
Anyway, my real problem is this. For example, I'm trying to make class Piece and class Pawn. In class Piece I got 1 image that applies at all pieces depending by a code (#define PAWN 13). In class Pawn I need to load an image from file. How do I do that?
Look what I made until now:
File whRook.h :
class whRook : public Piesa
{
private:
AnsiString strwhRookImg;
public:
whRook(TForm*);
void LoadImg();
};
File whRook.cpp :
whRook::whRook(TForm * form):Piesa(form){
strwhRookImg = "graphics/bmp/wh_rook.bmp";
}
void whRook::LoadImg(){
imPiesa->Picture->LoadFromFile(strwhRookImg);
}
File Piece.h :
class Piece
{
public:
TImage *imPiesa;
} piece[32];
Errors: At TImage *imPiece:
Type name expected
Declaration missing ;