/// <summary>
        /// Puts the value into the Logic insertMoney and returns true if the process was successful
        /// </summary>
        /// <param name="value"></param>
        /// <returns></returns>
        public bool InsertValue(int value)
        {
            bool result;

            result = ChangeMachine.InsertMoney(value);
            Update();
            return(result);
        }
 /// <summary>
 /// Set amount of money values in the eject
 /// </summary>
 private void SetEject()
 {
     int[] counterArray = new int[moneyValues.Length];
     for (int i = 0; i < moneyValues.Length; i++)
     {
         ChangeMachine.GetCounterForEjection(moneyValues[i], out int counter);
         counterArray[i] = counter;
     }
     ValuesInEject = counterArray;
 }
Exemplo n.º 3
0
 public void Initialize()
 {
     _changeMachine = new ChangeMachine();
 }
 /// <summary>
 /// decrease the value for selected change
 /// </summary>
 /// <param name="value"></param>
 public void DecreaseSelect(int value)
 {
     ChangeMachine.DecreseCounterForSelected(value);
     Update();
 }
 /// <summary>
 /// starts the changing process
 /// </summary>
 public void Change()
 {
     ChangeMachine.Change();
     Update();
 }
 /// <summary>
 /// Eject the changed money
 /// </summary>
 public void Eject()
 {
     ChangeMachine.EmptyEjection();
     Update();
 }
 /// <summary>
 /// Cancels the changing process
 /// </summary>
 public void Cancel()
 {
     ChangeMachine.CancelOrder();
     Update();
 }