?? player.java
字號:
package org.javagarden.j2me.fivelink.client;
/**
* 游戲玩家。
* @author Turbo Chen
* @created 2005-3-16
*/
public class Player
{
public final static int BLACK = 1;
public final static int WHITE = -1;
public final static int HUMAN = 1;
public final static int MACHINE = 0;
private int chessType;
private int score = 0;
private int id;
public int getScore()
{
return score;
}
public void setScore(int score)
{
this.score = score;
}
public boolean equals(Object obj)
{
if ( obj!=null )
{
if ( obj instanceof Player )
{
Player p = (Player)obj;
if ( p.id==this.id )
return true;
else
return false;
}else
return false;
}else
return false;
}
public String toString()
{
if ( this.id==MACHINE )
return "Mobile";
if ( this.id==HUMAN)
return "You";
return "Unknown";
}
public Player(int pid, int cType)
{
this.id = pid;
this.chessType = cType;
}
public int getChessType()
{
return chessType;
}
public void setChessType(int chessType)
{
this.chessType = chessType;
}
public int getId()
{
return id;
}
public void setId(int id)
{
this.id = id;
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -