private float GetPrice(char aCamel, List <Dictionary <char, float> > aList) { if (aList.Count == 0) { return(GameRules.LONG_TERM_PRICE[0]); } float retval = 0f; var comb = MathFunc.AllCombinationsBooleans(aList.Count); for (int i = 0; i < comb.Count; i++) { float combTotal = 1f; int trueTotal = 0; for (int boolIndex = 0; boolIndex < comb[i].Length; boolIndex++) { if (comb[i][boolIndex]) { trueTotal++; combTotal *= aList[boolIndex][aCamel]; } else { combTotal *= 1 - aList[boolIndex][aCamel]; } } retval += combTotal * GameRules.LONG_TERM_PRICE[trueTotal]; } return(retval); }