﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SimpleStatePattern
{
    public class StateB : StateBase
    {
        char currentLetter = 'B';
        public void Change(Context context)
        {
            Console.Write(System.Environment.NewLine + "The current letter is: " + currentLetter + System.Environment.NewLine);
            Console.WriteLine("Inc:1;Dec:2;Rst;3: ");
            ConsoleKeyInfo name = Console.ReadKey();
            switch (name.KeyChar)
            {
                case '1':
                    context.State = new StateC();
                    break;
                case '2':
                    context.State = new StateA();
                    break;
                case '3':
                    context.State = new StateA();
                    break;
                default:
                    context.State = new StateB();
                    break;
            }
        }
    }
}
