public void InicarMaquina() { context2 = new Context2(new StateA()); Console.WriteLine("Insira a moeda"); Console.ReadLine(); context2.InserirMoeda(); Console.WriteLine("Retirar moeda?"); var y = Console.ReadLine(); if (Int32.Parse(y) == 2) { context2.PedirCafe(); context2.RetirarCafe(); Console.WriteLine("Obrigado"); return; } else { Console.WriteLine("Entao vai po crl"); return; } }
//MODIFICA O CONTEXTO public void SetContext(Context2 context) { this._context = context; }