using System; abstract class Puzzle { public abstract string Category{ get; } public abstract string PuzzlePhrase{ get; } public abstract int NumberOfCharsToGuess(); } abstract class HighScoreEntry { public abstract Player Player { get; } public abstract int Score{ get; } } abstract class Player { public abstract string Name{ get; } } abstract class PuzzleCollection { public abstract string Count{ get; } public abstract Puzzle this[int i]{ get; } public abstract void Add(Puzzle p); } abstract class HighScoreList { /* Invariant: Entries always sorted */ public abstract void Open(string FileName); public abstract string Count{ get; } public abstract HighScoreEntry this[int i]{ get; } public abstract void Add(HighScoreEntry e); public abstract void Close(); } 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(); }