public bool SelectSoda(AbstractSoda soda) { if (_sodaMachine.CurrentBalance > 0) { _sodaMachine.CurrentState = _sodaMachine.SelectSodaState; _sodaMachine.CurrentState.SelectSoda(soda); } Console.WriteLine("First you have to add some money"); return(false); }
public bool SelectSoda(AbstractSoda soda) { if (_sodaMachine.ListOfSodas.Contains(soda)) { _sodaMachine.FoundSoda = soda; _sodaMachine.CurrentState = _sodaMachine.ReleaseSodaState; _sodaMachine.CurrentState.ReleaseSoda(); return(true); } else { Console.WriteLine("No such item in our vending machine"); return(false); } }
public bool SelectSoda(AbstractSoda soda) { Console.WriteLine("Invalid Operation"); return(false); }