public List <List <Card> > setupQuest(int stages, List <Card> hand, string questFoe) { // instantiate the quest line strategyUtil strat = new strategyUtil(); List <List <Card> > questLine = new List <List <Card> >(); // create the final stage first List <Card> finalStage = setupFoeStage(stages, stages, hand, questFoe, 0); int prevBP = strat.sumFoeEncounterCards(finalStage, questFoe); questLine.Add(finalStage); // if we have a test, create a test stage and then work from the first stage to fill in the foe stages if (strat.haveTest(hand)) { List <Card> testStage = setupTestStage(hand); questLine.Add(testStage); for (int i = 0; i < (stages - 2); i++) { List <Card> foeStage = setupFoeStage(i, stages, hand, questFoe, prevBP); questLine.Add(foeStage); prevBP = strat.sumFoeEncounterCards(foeStage, questFoe); } // else we don't have a test, we fill in foe stages the same way but 1 more for the missing test } else { for (int i = 0; i < (stages - 1); i++) { List <Card> foeStage = setupFoeStage(i, stages, hand, questFoe, prevBP); questLine.Add(foeStage); prevBP = strat.sumFoeEncounterCards(foeStage, questFoe); } } questLine.Reverse(); /* * for (int i = 0; i < questLine.Count; i++) * { * for (int j = 0; j < questLine[i].Count; j++) * { * questLine[i][j].display(); * } * } */ return(questLine); }
public List <List <Card> > setupQuest(int stages, List <Card> hand, string questFoe) { strategyUtil strat = new strategyUtil(); // initalize the quest line List <List <Card> > questLine = new List <List <Card> >(); // call setupFoeStage with stage == stages so it'll know to set up the FINAL encounter. List <Card> finalStage = setupFoeStage(stages, stages, hand, questFoe, 0); // get the BP of the foe encounter and add it to the questLine int prevBP = strat.sumFoeEncounterCards(finalStage, questFoe); questLine.Add(finalStage); // we either build the rest of the Quest taking into account a test encounter. if (strat.haveTest(hand)) { List <Card> testStage = setupTestStage(hand); questLine.Add(testStage); for (int i = 0; i < (stages - 2); i++) { List <Card> foeStage = setupFoeStage(i, stages, hand, questFoe, prevBP); prevBP = strat.sumFoeEncounterCards(foeStage, questFoe); questLine.Add(foeStage); } } // or a quest being filled by purely foe encounters else { for (int i = 0; i < (stages - 1); i++) { List <Card> foeStage = setupFoeStage(i, stages, hand, questFoe, prevBP); prevBP = strat.sumFoeEncounterCards(foeStage, questFoe); questLine.Add(foeStage); } } // reverse the quest because weve set up the stages backward then return questLine.Reverse(); return(questLine); }
public List <Card> setUpEarlyFoeEncounter(List <Card> hand, string questFoe, int prev) { strategyUtil strat = new strategyUtil(); List <Card> foeEncounter = new List <Card>(); List <Card> foes = new List <Card>(); for (int i = 0; i < hand.Count; i++) { if (hand[i].type == "Foe Card" && strat.getValidCardBP(hand[i], new List <Player>(), questFoe) < prev) { foes.Add(hand[i]); } } foes = strat.sortFoesByDescendingOrder(foes, questFoe); foeEncounter.Add(foes[0]); hand.Remove(foes[0]); for (int i = 0; i < hand.Count; i++) { if (hand[i].type == "Weapon Card" && strat.hasMultiple(hand, hand[i].name) && strat.checkDuplicate(hand[i], foeEncounter, "Weapon Card") && ((strat.sumFoeEncounterCards(foeEncounter, questFoe) + strat.getValidCardBP(hand[i], new List <Player>(), questFoe) < prev))) { foeEncounter.Add(hand[i]); hand.Remove(hand[i]); } } return(foeEncounter); }