コード例 #1
0
 public void AddCoinByUser(Purse purse, int nominal)
 {
     var coin = purse.TakeCoinByNominal(nominal);
     this.Purse.Add(coin);
     UserMoneySumm += nominal;
 }
コード例 #2
0
 public void TakeChange(Purse toPurse)
 {
     var currenCoins = Purse.GetAllCoins().OrderByDescending(i => i.Nominal).ToList();
     var changeCoins = CalculateCoins(currenCoins, UserMoneySumm);
     foreach (var changeCoin in changeCoins)
     {
         Purse.Dec(changeCoin);
         toPurse.Add(changeCoin);
     }
     UserMoneySumm = 0;
 }
コード例 #3
0
 public User()
 {
     Purse=new Purse();
 }