hangman-06-abstract/hangman.cs - The class HangmanGame. | Lecture 1 - slide 22 : 22 Program 6 |
public enum GameState {Ongoing, Won, Lost} abstract class HangmanGame { /* Encapsulates the data of a single play of Hangman */ /** Set the puzzle of this game */ public abstract void setPuzzle(Puzzle p); /** Get the secret puzzle of this game */ public abstract Puzzle CurrentPuzzle(); /** Set the alphabet of this game - a array of all possible chars */ public abstract void setAlphabet(char[] alphabet); /** Return the array of all chars not yet guessed */ public abstract char[] RemainingAlphabet(); /** Return a string which represents the guessing state */ public abstract string PuzzleOutline(Puzzle p); /** Call this method when the user wish to attempt ch */ public abstract void GuessChar(char ch); /** Return the state of the game - Won, Lost or Ongoing */ public abstract GameState GameState(); /** Return the number of points obtained until now in this game */ public abstract int HowManyPoints(); }