|
|||||||||
前のクラス 次のクラス | フレームあり フレームなし | ||||||||
概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |
java.lang.ObjectPlayer
public class Player
ジャンケンのプレイヤーを表すクラス。
フィールドの概要 | |
---|---|
private java.lang.String |
name
プレイヤーの名前 |
static int |
PAPER
|
static int |
SCISSORS
|
static int |
STONE
|
private int |
winCount
プレイヤーの勝った回数 |
コンストラクタの概要 | |
---|---|
Player(java.lang.String name)
プレイヤークラスのコンストラクタ。 |
メソッドの概要 | |
---|---|
java.lang.String |
getName()
自分の名前を答える。 |
int |
getWinCount()
自分の勝った回数を答える。 |
void |
notifyResult(boolean result)
審判から勝敗を聞く。 |
int |
showHand()
ジャンケンの手を出す。 |
クラス java.lang.Object から継承されたメソッド |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
フィールドの詳細 |
---|
public static final int STONE
public static final int SCISSORS
public static final int PAPER
private java.lang.String name
private int winCount
コンストラクタの詳細 |
---|
public Player(java.lang.String name)
name
- 名前メソッドの詳細 |
---|
public int showHand()
public void notifyResult(boolean result)
result
- true:勝ち,false:負けpublic int getWinCount()
public java.lang.String getName()
|
|||||||||
前のクラス 次のクラス | フレームあり フレームなし | ||||||||
概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |