コード例 #1
0
        public MainWindow()
        {
            InitializeComponent();

            ReceivedMoney = new SingleCurrencyWallet(_currentRegion);
            CustomerWallet = InitCustomerWallet();
            VendingMachineWallet = InitVendingMachineWallet();
            ProductAmounts = new Dictionary<Guid, int>();
            Categories = new List<Category>();
            InitCategories();
            RefreshData();
        }
コード例 #2
0
        private ISingleCurrencyWallet InitVendingMachineWallet()
        {
            var wallet = new SingleCurrencyWallet(_currentRegion);

            foreach (var denomination in new[] { 1m, 2m, 5m, 10m })
            {
                for (int i = 0; i < 100; i++)
                {
                    wallet.Push(new Coin(denomination, _currentRegion));
                }
            }

            return wallet;
        }
コード例 #3
0
        private ISingleCurrencyWallet InitCustomerWallet()
        {
            var wallet = new SingleCurrencyWallet(_currentRegion);

            for (int i = 0; i < 10; i++)
            {
                wallet.Push(new Coin(1m, _currentRegion));
            }

            for (int i = 0; i < 30; i++)
            {
                wallet.Push(new Coin(2m, _currentRegion));
            }

            for (int i = 0; i < 20; i++)
            {
                wallet.Push(new Coin(5m, _currentRegion));
            }

            for (int i = 0; i < 15; i++)
            {
                wallet.Push(new Coin(10m, _currentRegion));
            }

            return wallet;
        }