Commit ebc68736 authored by kimia's avatar kimia

javaDoc for classes

parent 713c33f3
/**
* Bishop class show the Bishop's moves that moves diagonally, and can move as far as a player wants it to unless another piece blocks it.
*@author kimiadorani
*@version 1.0
*@since 2019-5-7
*/
public class Bishop extends Piece { public class Bishop extends Piece {
public Bishop(Cell cell, PieceColor pieceColor) { public Bishop(Cell cell, PieceColor pieceColor)
{
super(cell, pieceColor) ; super(cell, pieceColor) ;
} }
......
/**
* Cell class show's the cells in a board for pieces.
*@author kimiadorani
*@version 1.0
*@since 2019-5-7
*/
class Cell { class Cell {
private int row, col ; private int row, col ;
private boolean empty ; private boolean empty ;
......
...@@ -3,7 +3,12 @@ import java.awt.*; ...@@ -3,7 +3,12 @@ import java.awt.*;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
import java.util.ArrayList; import java.util.ArrayList;
/**
* ChessBoardGUI is a class that show's the graphical form of the game.
*@author kimiadorani
*@version 1.0
*@since 2019-5-7
*/
public class ChessBoardGUI extends JPanel { public class ChessBoardGUI extends JPanel {
public JButton[][] button = new JButton[8][8]; public JButton[][] button = new JButton[8][8];
private JPanel whiteRemovedPiecePanel; private JPanel whiteRemovedPiecePanel;
......
import javax.swing.*; import javax.swing.*;
import java.awt.*; import java.awt.*;
/**
* ChessGameGUI is a class where we set the size and positions of the frames
*@author kimiadorani
*@version 1.0
*@since 2019-5-7
*/
public class ChessGameGUI extends JFrame { public class ChessGameGUI extends JFrame {
public static void main(String args[]){ public static void main(String args[]){
new ChessGameGUI(); new ChessGameGUI();
......
/**
* King class show the king's move that can move only one to any direction .(king ia the most important piece in chess)
*@author kimiadorani
*@version 1.0
*@since 2019-5-7
*/
public class King extends Piece { public class King extends Piece {
public King(Cell cell, PieceColor pieceColor) { public King(Cell cell, PieceColor pieceColor) {
super(cell, pieceColor) ; super(cell, pieceColor) ;
......
import java.util.Scanner; import java.util.Scanner;
/**
*prints board and control the moves of the pieces
*@author kimiadorani
*@version 1.0
*@since 2019-5-7
*/
public class Main{ public class Main{
/**
*prints board and control the moves of the pieces
*@author kimiadorani
*@version 1.0
*@since 2019-5-7
*/
private static char boardChar[][] = new char [8][8] ; private static char boardChar[][] = new char [8][8] ;
......
/**
* Pawn class show the pawn's moves that can move forward one or two step in their first move , after that they can only move one space forward , to capture , the pawn moves one step diagonally.
*@author kimiadorani
*@version 1.0
*@since 2019-5-7
*/
public class Pawn extends Piece{ public class Pawn extends Piece{
private boolean once, end ; private boolean once, end ;
......
import javax.imageio.ImageIO; import javax.imageio.ImageIO;
import java.awt.*; import java.awt.*;
import java.io.File; import java.io.File;
/**
* Piece is an abstract class that all pieces extend from and here we match pics to pieces too.
*@author kimiadorani
*@version 1.0
*@since 2019-5-7
*/
public abstract class Piece { public abstract class Piece {
private Cell cell ; private Cell cell ;
......
/**
* Player class is where we set the pieces and create them
*@author kimiadorani
*@version 1.0
*@since 2019-5-7
*/
public class Player { public class Player {
private Piece[] pieces = new Piece[16] ; private Piece[] pieces = new Piece[16] ;
private PieceColor pieceColor; private PieceColor pieceColor;
......
/**
* Queen class show the Queen's moves which is the most powerful piece in the game , It reunites the power of rook and the bishop ( it can go in a straight line horizontally and vertically also it can move diagonally.
*@author kimiadorani
*@version 1.0
*@since 2019-5-7
*/
public class Queen extends Piece { public class Queen extends Piece {
......
/** /**
* shows the moves of the rook , it can move straight * shows the moves of the rook , it can move in a straight line horizontally or vertically.
* @author kimiadorani *@author kimiadorani
* @version 1.0 *@version 1.0
*@since 2019-5-7
*/ */
public class Rook extends Piece { public class Rook extends Piece {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment