|
|||||||||||
前のクラス 次のクラス | フレームあり フレームなし | ||||||||||
概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |
java.lang.ObjectPlayer
ジャンケンを行うプレイヤークラス。
フィールドの概要 | |
private String |
name
プレイヤーの名前 |
static int |
PAPER
パー |
static int |
SCISSORS
チョキ |
static int |
STONE
グー |
private Tactics |
tactics
与えられた戦略 |
private int |
winCount
プレイヤーの勝った回数 |
コンストラクタの概要 | |
Player(String name)
プレイヤークラスのコンストラクタ。 |
メソッドの概要 | |
(パッケージプライベート) String |
getName()
自分の名前を答える。 |
(パッケージプライベート) int |
getWinCount()
自分の勝った回数を答える |
(パッケージプライベート) void |
notifyResult(boolean result)
勝敗を聞く(教える)。 |
(パッケージプライベート) void |
setTactics(Tactics tactics)
プレイヤーに戦略を渡す。 |
(パッケージプライベート) 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 String name
private int winCount
private Tactics tactics
コンストラクタの詳細 |
public Player(String name)
name
- 名前メソッドの詳細 |
void setTactics(Tactics tactics)
tactics
- 戦略int showHand()
void notifyResult(boolean result)
result
- true:勝ち,false:負けint getWinCount()
String getName()
|
|||||||||||
前のクラス 次のクラス | フレームあり フレームなし | ||||||||||
概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |