man.java
来自「SWT实现人人的象棋程序 供学习SWT的同志做个参考」· Java 代码 · 共 31 行
JAVA
31 行
package com.catking.GUI.leftToolBar;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.widgets.Canvas;
import com.catking.Utility.ChessKind;
public class Man extends Player implements ChessKind{
public Man(){
this.name = "隐者";
this.headImageFile = "Img/man.bmp";
this.kind = ATTACK_UP;
this.position =
(this.kind == ATTACK_UP) ? new Point(0, 470) : new Point(0, 0);
}
public Man(String name, String fileName, int kind){
this.name = name;
this.headImageFile = fileName;
this.kind = kind;
this.position =
(this.kind == ATTACK_UP) ? new Point(0, 470) : new Point(0, 0);
}
public Point getPos(){
return this.position;
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?