S
sam_cit
Hi Everyone,
I'm working on developing a chess game and i decided to use c++ for
its object oriented approach. I have a bass class unit and is
inherited to distinct number of units (like king, queen, pawns
etc...), i will have pure virtual functions in the base class for
move(), attack() etc which are applicable to all units and would
override them in the child classes. Function specific to pawn like
recovering of another unit once it reaches the end of the chess board
will be implemented in the child class specific to pawn.
I also plan to use a global 2D (10*10) array of structure used to
represent the chess board along with status of each location (free/
occupied, color).
Is this a good approach? People do say that global variables in
case of oops programming, Is that correct?
Thanks in advance!!!
I'm working on developing a chess game and i decided to use c++ for
its object oriented approach. I have a bass class unit and is
inherited to distinct number of units (like king, queen, pawns
etc...), i will have pure virtual functions in the base class for
move(), attack() etc which are applicable to all units and would
override them in the child classes. Function specific to pawn like
recovering of another unit once it reaches the end of the chess board
will be implemented in the child class specific to pawn.
I also plan to use a global 2D (10*10) array of structure used to
represent the chess board along with status of each location (free/
occupied, color).
Is this a good approach? People do say that global variables in
case of oops programming, Is that correct?
Thanks in advance!!!