|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectActivity
de.palmmedia.yahtzee.Game
public class Game
The activity where the game is played.
Each player can roll the dices three times, the dices can be locked to exclude them from rolling.
As soon as the player has marked an Element
it's the next player's turn.
Field Summary | |
---|---|
private List<ElementButton> |
elementButtons
The buttons that allow to select an element. |
private OnClickListener |
markListener
Executed when an element is selected. |
(package private) MediaPlayer |
rollingDicesMediaPlayer
Mediaplayer to play sound. |
private ShakeDetector |
shakeDetector
ShakeDetector to roll dices when device is shook. |
private ShakeEventListener |
shakeEventListener
Executed when device is shook. |
Constructor Summary | |
---|---|
Game()
|
Method Summary | |
---|---|
private View |
createElementView(Element element)
Creates a view for the given Element . |
private GameContext |
getGameContext()
Get the GameContext . |
private void |
markElement(ElementButton markedElementButton)
Executed when an element is marked. |
void |
nextPlayer(View view)
Shows the next player. |
void |
onCreate(Bundle savedInstanceState)
|
protected void |
onPause()
|
protected void |
onResume()
|
void |
rollDices(View view)
Rolls the dices. |
private void |
showScores()
Shows the results at the end of the game. |
private void |
undoMarking()
Remove the marking from the marked element. |
private void |
update()
Update the UI, except the elements. |
private void |
updateElements()
Update the elements. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private ShakeDetector shakeDetector
ShakeDetector
to roll dices when device is shook.
MediaPlayer rollingDicesMediaPlayer
private List<ElementButton> elementButtons
private OnClickListener markListener
private ShakeEventListener shakeEventListener
Constructor Detail |
---|
public Game()
Method Detail |
---|
private GameContext getGameContext()
GameContext
.
GameContext
.public void onCreate(Bundle savedInstanceState)
protected void onResume()
protected void onPause()
public void rollDices(View view)
view
- The view.public void nextPlayer(View view)
view
- The view.private void markElement(ElementButton markedElementButton)
markedElementButton
- private void undoMarking()
private void showScores()
private void update()
private void updateElements()
private View createElementView(Element element)
Element
.
element
- The Element
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |