クラス Player

java.lang.Object
  上位を拡張 Player

public class Player
extends java.lang.Object

ジャンケンのプレイヤーを表すクラス。


フィールドの概要
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
 

フィールドの詳細

STONE

public static final int STONE
関連項目:
定数フィールド値

SCISSORS

public static final int SCISSORS
関連項目:
定数フィールド値

PAPER

public static final int PAPER
関連項目:
定数フィールド値

name

private java.lang.String name
プレイヤーの名前


winCount

private int winCount
プレイヤーの勝った回数

コンストラクタの詳細

Player

public Player(java.lang.String name)
プレイヤークラスのコンストラクタ。

パラメータ:
name - 名前
メソッドの詳細

showHand

public int showHand()
ジャンケンの手を出す。

戻り値:
ジャンケンの手

notifyResult

public void notifyResult(boolean result)
審判から勝敗を聞く。

パラメータ:
result - true:勝ち,false:負け

getWinCount

public int getWinCount()
自分の勝った回数を答える。

戻り値:
勝った回数

getName

public java.lang.String getName()
自分の名前を答える。

戻り値:
名前