Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package hilomocked;
- import java.util.Observable;
- /**
- * AbstractGame is a base class for all HiLo Games.
- *
- * @author jdalbey
- */
- public abstract class AbstractGame extends Observable
- {
- public enum Guess
- {
- low, high
- };
- public AbstractGame()
- {
- }
- /**
- * Accessor to how much money the user has.
- */
- public abstract int getBalance();
- /**
- * Accessor to the current number.
- */
- public abstract int getCurrentNum();
- /**
- * Take a turn
- *
- * @param guess The user's guess if the next number is higher or lower than
- * current.
- * @post outcome is computed and bankroll updated, a new currentNum is
- * selected randomly.
- */
- public abstract void takeTurn(Guess guess);
- }
Advertisement
Add Comment
Please, Sign In to add comment