jdalbey

AbstractGame for HiLo mocking

Apr 21st, 2016
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. package hilomocked;
  2.  
  3. import java.util.Observable;
  4.  
  5. /**
  6. * AbstractGame is a base class for all HiLo Games.
  7. *
  8. * @author jdalbey
  9. */
  10. public abstract class AbstractGame extends Observable
  11. {
  12.  
  13. public enum Guess
  14. {
  15.  
  16. low, high
  17. };
  18.  
  19. public AbstractGame()
  20. {
  21. }
  22.  
  23. /**
  24. * Accessor to how much money the user has.
  25. */
  26. public abstract int getBalance();
  27.  
  28. /**
  29. * Accessor to the current number.
  30. */
  31. public abstract int getCurrentNum();
  32.  
  33. /**
  34. * Take a turn
  35. *
  36. * @param guess The user's guess if the next number is higher or lower than
  37. * current.
  38. * @post outcome is computed and bankroll updated, a new currentNum is
  39. * selected randomly.
  40. */
  41. public abstract void takeTurn(Guess guess);
  42. }
Advertisement
Add Comment
Please, Sign In to add comment