models
Class Match
java.lang.Object
models.Game
models.Match
public class Match
- extends Game
- Author:
- Sulake 2012
Match class that controls the game between two players
Constructor Summary |
Match(com.sulake.habbo.gaming.api.domain.Player p1,
com.sulake.habbo.gaming.api.domain.Player p2)
|
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Match
public Match(com.sulake.habbo.gaming.api.domain.Player p1,
com.sulake.habbo.gaming.api.domain.Player p2)
getMinRange
public int getMinRange()
- Returns:
- return the minimun value for the range
getMaxRange
public int getMaxRange()
- Returns:
- the maximum value for the range
getPlayer
public Players getPlayer(java.lang.String aToken)
getPlayer1
public Players getPlayer1()
- Returns:
- the player 1
getPlayer2
public Players getPlayer2()
- Returns:
- The player 2
whoIsFirst
public java.lang.String whoIsFirst()
whoIsFirstName
public java.lang.String whoIsFirstName()
- Returns:
- the name of the first player
whoWins
public java.lang.String whoWins()
- Returns:
- access token of the winner
setNumber
public void setNumber(int number,
java.lang.String aToken)
- Parameters:
integer
- numberString
- access token
set the number that a user introduce
getTries
public int getTries()
- Returns:
- the number of tries are left for player 2
myTurn
public boolean myTurn(java.lang.String aToken)
checkWinner
public void checkWinner()
getWinner
public Players getWinner()
buyHalf
public void buyHalf(int amount)
- Parameters:
amount
- of Half the user wants to buy
buyCut
public void buyCut(int amount)
- Parameters:
amount
- of Cut the user wants to buy
halfRange
public void halfRange()
- Execute the Half range and update the range
cutRange
public void cutRange()
- Execute the Cut range and update the range
inRange
public boolean inRange(int num)
- Parameters:
integer
- number, check if the intruced number is within the range
getCut
public int getCut()
- Returns:
- amount of cut the range left
getHalf
public int getHalf()
- Parameters:
Amount
- of half the range left
getPurse
public int getPurse()
- Returns:
- the amount of the Purse