org.jboss.weld.environment.se.example.numberguess
Class Game
java.lang.Object
org.jboss.weld.environment.se.example.numberguess.Game
@ApplicationScoped
public class Game
- extends Object
This class contains the pure logic of the Number Guess game. On
initialization a random number will be selected. Multiple "guesses" as to
what that number might be can be made using the 'check' method. The user wins
if they can guess the selected number in the alloted amount of tries.
- Author:
- Peter Royle
|
Constructor Summary |
Game()
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MAX_NUM_GUESSES
public static final int MAX_NUM_GUESSES
- See Also:
- Constant Field Values
Game
public Game()
getNumber
public int getNumber()
getGuess
public int getGuess()
setGuess
public void setGuess(int guess)
getSmallest
public int getSmallest()
getBiggest
public int getBiggest()
getRemainingGuesses
public int getRemainingGuesses()
isValidNumberRange
public boolean isValidNumberRange()
isGameWon
public boolean isGameWon()
isGameLost
public boolean isGameLost()
check
public boolean check()
reset
@PostConstruct
public void reset()
Copyright © 2008-2011 Seam Framework. All Rights Reserved.