Commit f3f2350a authored by lynn's avatar lynn
Browse files

变更

parent 8e145e05
Loading
Loading
Loading
Loading
+19 −0
Original line number Diff line number Diff line
package chessComponent;

import controller.ClickController;
import model.ChessColor;
import model.ChessboardPoint;

import java.awt.*;

public class AdvisorChessComponent extends ChessComponent{
    protected AdvisorChessComponent(ChessboardPoint chessboardPoint, Point location,
                                    ChessColor chessColor, ClickController clickController, int size) {
        super(chessboardPoint, location, chessColor, clickController, size);
        if (this.getChessColor() == ChessColor.RED) {
            name = "仕";
        } else {
            name = "士";
        }
    }
}
+19 −0
Original line number Diff line number Diff line
package chessComponent;

import controller.ClickController;
import model.ChessColor;
import model.ChessboardPoint;

import java.awt.*;

public class CannonChessComponent extends  ChessComponent{
    protected CannonChessComponent(ChessboardPoint chessboardPoint, Point location,
                                   ChessColor chessColor, ClickController clickController, int size) {
        super(chessboardPoint, location, chessColor, clickController, size);
        if (this.getChessColor() == ChessColor.RED) {
            name = "炮";
        } else {
            name = "砲";
        }
    }
}
+2 −1
Original line number Diff line number Diff line
@@ -11,7 +11,8 @@ import java.awt.*;
 */
public class ChariotChessComponent extends ChessComponent {

    public ChariotChessComponent(ChessboardPoint chessboardPoint, Point location, ChessColor chessColor, ClickController clickController, int size) {
    public ChariotChessComponent(ChessboardPoint chessboardPoint, Point location,
                                 ChessColor chessColor, ClickController clickController, int size) {
        super(chessboardPoint, location, chessColor, clickController, size);
        if (this.getChessColor() == ChessColor.RED) {
            name = "俥";
+2 −1
Original line number Diff line number Diff line
@@ -12,7 +12,8 @@ import java.awt.*;
public class ChessComponent extends SquareComponent{
    protected String name;// 棋子名字:例如 兵,卒,士等

    protected ChessComponent(ChessboardPoint chessboardPoint, Point location, ChessColor chessColor, ClickController clickController, int size) {
    protected ChessComponent(ChessboardPoint chessboardPoint, Point location,
                             ChessColor chessColor, ClickController clickController, int size) {
        super(chessboardPoint, location, chessColor, clickController, size);
    }
    @Override
+19 −0
Original line number Diff line number Diff line
package chessComponent;

import controller.ClickController;
import model.ChessColor;
import model.ChessboardPoint;

import java.awt.*;

public class GeneralChessComponent extends ChessComponent {
    protected GeneralChessComponent(ChessboardPoint chessboardPoint, Point location,
                                    ChessColor chessColor, ClickController clickController, int size) {
        super(chessboardPoint, location, chessColor, clickController, size);
        if (this.getChessColor() == ChessColor.RED) {
            name = "帥";
        } else {
            name = "將";
        }
    }
}
Loading