static void Main(string[] args) { TurnstileController controller = new TurnstileController(); Turnstile turnstile = new Turnstile(controller); turnstile.Coin(); // Imprime: Desbloqueado! turnstile.Pass(); // Imprime: Te bloqueo! turnstile.Pass(); // Imprime: ALARMAAAAAAAAAAAA! Console.ReadKey(); }
public void Pass(Turnstile context) { context.SetLocked(); context.Lock(); }
public void Coin(Turnstile context) { context.ThankYou(); }
public void Pass(Turnstile context) { context.Alarm(); }
public void Coin(Turnstile context) { context.SetUnlocked(); context.Unlock(); }