static void Main(string[] args) { var Interface = new InterfaceHandler(); //Greet user Interface.Greeting(); //Get response from user char response = Interface.GetResponse(); //Respond to user, can use any subclass of Feeling var Handler = new ResponseHandler(response); Feeling Today = Handler.Today; Today.Respond(Interface); }
public ResponseHandler(char response) { if (response == 'O' || response == 'o') { Today = new FeelingOk(); } else if (response == 'B' || response == 'b') { Today = new FeelingBad(); } else if (response == 'G' || response == 'g') { Today = new FeelingGreat(); } else { Today = new Feeling(); } }