Chess Design Issues
I''m writing a pretty simple (so far) chess game for my C.S. class. I''m using OOP w/ C++ and so far it has gone pretty good, the design, I mean. Here''s what I have so far:
Chess_Game
Master class. Interacts with all the other classes. In charge of setting up the game.
Chess_Player
Class used to interact with the Chess_Game object. Maintains the score of a player, the player''s color, and player''s name, history, stuff like that.
Chess_Piece
Class used to maintain the color, type, and position of a piece. It also provides information about where it can and cannot move, based on the piece it represents (i.e. "i am a king, so i can only move one space in any direction")
Chess_Board
Class used to contain the Chess_Piece(s), and give them information about where they can and cannot move (i.e. "a piece of the same color is in the way", or "you are moving off of the board", or "that move is fine, you are not violating any rules").
Chess_Display
Class used to draw a Chess_Board to the screen.
Yesterday is the past, tomorrow is the future. Today is a gift, that is why we call it the present.
I think instead of using a ChessPeice class, you should have a 2D array of ChessCel objects. ChessPeice would be a data member in a ChessCel object. Just my opinion. Seems easier that way.
-Forcas
"Elvis is alive. He is Barney the purple dinosaur. He is the pied piper that leads our children into the wages of sin and eternal damnation."
-Forcas
"Elvis is alive. He is Barney the purple dinosaur. He is the pied piper that leads our children into the wages of sin and eternal damnation."
-Forcaswriteln("Does this actually work?");
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement