コード例 #1
0
        public void AddCoinToAvailableCoinTube(CoinSpecification coinType)
        {
            for (var i = 0; i < CoinTubes.Count(); i++)
            {
                var coinTube = CoinTubes[i];

                if (coinTube.Spec == coinType && coinTube.CountInTube < coinTube.Capacity)
                {
                    // Direct inserted coin to the available coin tube
                    coinTube.CountInTube++;
                    return;
                }
            }

            // Direct inserted coin to cash box
        }
コード例 #2
0
 public int GetCoinInventory(CoinSpecification coinType)
 {
     return(CoinTubes.Where(i => i.Spec == coinType)
            .Sum(i => i.CountInTube));
 }
コード例 #3
0
 public CoinDispensedEventArgs(CoinSpecification coinSpec)
 {
     this.CoinSpec = coinSpec;
 }