Created
October 10, 2012 11:59
-
-
Save anupamsharma/3865171 to your computer and use it in GitHub Desktop.
Simple Multiplayer Chess Game...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class AbstractPosition {} | |
protected class ChessPiece { | |
enum color | |
enum player | |
// not really needed | |
is_alive | |
protected boolean is_valid_move(int x1, int y1, int x2, int y2); | |
} | |
public class AbstractGameManager { | |
piece player1_pieces[]; | |
piece player1_pieces[]; | |
GameManager() { | |
} | |
public getCurrentSituation() { | |
} | |
public isMatchConcluded() { | |
} | |
public whoWon() { | |
} | |
public boolean move(player, positioin1, position2) { | |
} | |
} | |
/* Just have child classes with different implementations of is_valid_move */ | |
protected class Horse extends ChessPiece { | |
protected boolean is_valid_move(int x1, int y1, int x2, int y2) { | |
// Some implementation | |
} | |
} | |
protected ChessBlock { | |
color | |
piece | |
has_piece() | |
get_piece() | |
set_piece() | |
} | |
..... | |
..... | |
.... | |
public class ChessBoardManager { | |
public static final BLACK = True; | |
public static final WHITE = False; | |
public static ROW_LENGTH = 8; | |
ChessBlock chess_blocks[][]; | |
piece player1_pieces[]; | |
piece player1_pieces[]; | |
ChessBoardManager() { | |
chess_blocks = new ChessBlock[ROW_LENGTH][ROW_LENGTH]; | |
int row_counter = 0; | |
for(int row_counter=0; row_counter < ;) { | |
} | |
} | |
move(player, x1, x2, x3, x4) { | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment