예제 #1
0
        private static ChangeOptionList SetUpInitialPossibleChangeOptions()
        {
            var changeObjectList = new ChangeOptionList();

            changeObjectList.AddChangeOption(0);
            return(changeObjectList);
        }
예제 #2
0
        private static void UpdateChangeOption(ChangeOptionList possibleChangeOptions, int targetValue, int coin, ChangeOption existingChangeOption)
        {
            var newCoinList = CreateNewCoinList(coin, existingChangeOption);

            if (!possibleChangeOptions.ChangeOptionExistsForTargetValue(targetValue))
            {
                possibleChangeOptions.AddChangeOption(targetValue, newCoinList);
            }
            else
            {
                possibleChangeOptions.GetChangeOption(targetValue).SetChangeCoins(newCoinList);
            }
        }