|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectru.ifmo.knim.main.GameInfo
Represents game info
Field Summary | |
static int |
DIFFICULTY_EASY
"Easy" level of difficulty |
static int |
DIFFICULTY_HARD
"Hard" level of difficulty |
static int |
DIFFICULTY_MEDIUM
"Medium" level of difficulty |
static int |
DIFFICULTY_NONE
No difficulty at all |
Constructor Summary | |
GameInfo(int nLines)
Creates a gameinfo object |
|
GameInfo(int[] stones)
non-default contructor |
Method Summary | |
int |
getBadMoveLeft()
Returns the amount of phora moves left |
int |
getFishInLine(int lineIdx)
Returns amount of fish in a line |
int |
getLineAmount()
Returns the amount of lines with stones |
int[] |
getLines()
Gets array of fish lines |
boolean |
isGameover()
Detects whether the game is over or not |
void |
restartGame()
Restarts game. |
void |
setBadMovesLeft(int badMovesLeft)
Sets the amount of phora moves |
int |
setGetDifficulty(int difficulty)
Very cool function -- analog of compareAndSet primitive |
void |
setStones(int[] stones)
Set array of stones as rules for new game |
void |
takeStones(int lineIdx,
int amount)
Takes the given amount of stones from the given line |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int DIFFICULTY_EASY
public static final int DIFFICULTY_MEDIUM
public static final int DIFFICULTY_HARD
public static final int DIFFICULTY_NONE
Constructor Detail |
public GameInfo(int nLines)
nLines
- - amount of lines in a gamepublic GameInfo(int[] stones)
stones
- Method Detail |
public final int[] getLines()
public void setStones(int[] stones)
stones
- public void restartGame()
public final int setGetDifficulty(int difficulty)
difficulty
-
public int getLineAmount()
public int getFishInLine(int lineIdx)
lineIdx
- - the line idx
public void takeStones(int lineIdx, int amount)
lineIdx
- - the line idxamount
- - amount of stones to takepublic int getBadMoveLeft()
public void setBadMovesLeft(int badMovesLeft)
badMovesLeft
- the amount of phora movespublic boolean isGameover()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |