public static void Populate_UserOps_Lists() { OperatorClassLists operatorClassesLists = Program.operatorClassesLists; List <string> userOps = Program.userOps; ListWiper.Wipe_Many_Lists_Clean(operatorClassesLists.userMedicOperators, operatorClassesLists.userSupporterOperators, operatorClassesLists.userSniperOperators, operatorClassesLists.userVanguardOperators, operatorClassesLists.userSpecialistOperators, operatorClassesLists.userDefenderOperators, operatorClassesLists.userGuardOperators, operatorClassesLists.userCasterOperators); for (int i = 0; i < userOps.Count; i++) { for (int x = 0; x < operatorClassesLists.medicOperators.Count; x++) { if (userOps[i] == operatorClassesLists.medicOperators[x]) { operatorClassesLists.userMedicOperators.Add(operatorClassesLists.medicOperators[x]); operatorClassesLists.defaultUserMedicOperators.Add(operatorClassesLists.medicOperators[x]); } } } for (int i = 0; i < userOps.Count; i++) { for (int x = 0; x < operatorClassesLists.supporterOperators.Count; x++) { if (userOps[i] == operatorClassesLists.supporterOperators[x]) { operatorClassesLists.userSupporterOperators.Add(operatorClassesLists.supporterOperators[x]); operatorClassesLists.defaultUserSupporterOperators.Add(operatorClassesLists.supporterOperators[x]); } } } for (int i = 0; i < userOps.Count; i++) { for (int x = 0; x < operatorClassesLists.sniperOperators.Count; x++) { if (userOps[i] == operatorClassesLists.sniperOperators[x]) { operatorClassesLists.userSniperOperators.Add(operatorClassesLists.sniperOperators[x]); operatorClassesLists.defaultUserSniperOperators.Add(operatorClassesLists.sniperOperators[x]); } } } for (int i = 0; i < userOps.Count; i++) { for (int x = 0; x < operatorClassesLists.vanguardOperators.Count; x++) { if (userOps[i] == operatorClassesLists.vanguardOperators[x]) { operatorClassesLists.userVanguardOperators.Add(operatorClassesLists.vanguardOperators[x]); operatorClassesLists.defaultUserVanguardOperators.Add(operatorClassesLists.vanguardOperators[x]); } } } for (int i = 0; i < userOps.Count; i++) { for (int x = 0; x < operatorClassesLists.specialistOperators.Count; x++) { if (userOps[i] == operatorClassesLists.specialistOperators[x]) { operatorClassesLists.userSpecialistOperators.Add(operatorClassesLists.specialistOperators[x]); operatorClassesLists.defaultUserSpecialistOperators.Add(operatorClassesLists.specialistOperators[x]); } } } for (int i = 0; i < userOps.Count; i++) { for (int x = 0; x < operatorClassesLists.defenderOperators.Count; x++) { if (userOps[i] == operatorClassesLists.defenderOperators[x]) { operatorClassesLists.userDefenderOperators.Add(operatorClassesLists.defenderOperators[x]); operatorClassesLists.defaultUserDefenderOperators.Add(operatorClassesLists.defenderOperators[x]); } } } for (int i = 0; i < userOps.Count; i++) { for (int x = 0; x < operatorClassesLists.guardOperators.Count; x++) { if (userOps[i] == operatorClassesLists.guardOperators[x]) { operatorClassesLists.userGuardOperators.Add(operatorClassesLists.guardOperators[x]); operatorClassesLists.defaultUserGuardOperators.Add(operatorClassesLists.guardOperators[x]); } } } for (int i = 0; i < userOps.Count; i++) { for (int x = 0; x < operatorClassesLists.casterOperators.Count; x++) { if (userOps[i] == operatorClassesLists.casterOperators[x]) { operatorClassesLists.userCasterOperators.Add(operatorClassesLists.casterOperators[x]); operatorClassesLists.defaultUserCasterOperators.Add(operatorClassesLists.casterOperators[x]); } } } }
public static void Filter_Out_Unselected_Rarities_From_Pool_Of_UserOps(OperatorRarityLists rarityLists, OperatorClassLists classesLists, List <string> listOfUserOps) //THIS CLASS IS BAD AND NEEDS FRAGMENTING INTO SMALLER CLASSES { for (int i = 0; i < rarityLists.raritiesToFilterOut.Count; i++) { switch (rarityLists.raritiesToFilterOut[i]) { case "1*": { for (int x = 0; x < rarityLists.oneStarOperators.Count; x++) { listOfUserOps.Remove(rarityLists.oneStarOperators[x]); classesLists.userMedicOperators.Remove(rarityLists.oneStarOperators[x]); classesLists.userSupporterOperators.Remove(rarityLists.oneStarOperators[x]); classesLists.userSniperOperators.Remove(rarityLists.oneStarOperators[x]); classesLists.userVanguardOperators.Remove(rarityLists.oneStarOperators[x]); classesLists.userSpecialistOperators.Remove(rarityLists.oneStarOperators[x]); classesLists.userDefenderOperators.Remove(rarityLists.oneStarOperators[x]); classesLists.userGuardOperators.Remove(rarityLists.oneStarOperators[x]); classesLists.userCasterOperators.Remove(rarityLists.oneStarOperators[x]); } break; } case "2*": { for (int x = 0; x < rarityLists.twoStarOperators.Count; x++) { listOfUserOps.Remove(rarityLists.twoStarOperators[x]); classesLists.userMedicOperators.Remove(rarityLists.twoStarOperators[x]); classesLists.userSupporterOperators.Remove(rarityLists.twoStarOperators[x]); classesLists.userSniperOperators.Remove(rarityLists.twoStarOperators[x]); classesLists.userVanguardOperators.Remove(rarityLists.twoStarOperators[x]); classesLists.userSpecialistOperators.Remove(rarityLists.twoStarOperators[x]); classesLists.userDefenderOperators.Remove(rarityLists.twoStarOperators[x]); classesLists.userGuardOperators.Remove(rarityLists.twoStarOperators[x]); classesLists.userCasterOperators.Remove(rarityLists.twoStarOperators[x]); } break; } case "3*": { for (int x = 0; x < rarityLists.threeStarOperators.Count; x++) { listOfUserOps.Remove(rarityLists.threeStarOperators[x]); classesLists.userMedicOperators.Remove(rarityLists.threeStarOperators[x]); classesLists.userSupporterOperators.Remove(rarityLists.threeStarOperators[x]); classesLists.userSniperOperators.Remove(rarityLists.threeStarOperators[x]); classesLists.userVanguardOperators.Remove(rarityLists.threeStarOperators[x]); classesLists.userSpecialistOperators.Remove(rarityLists.threeStarOperators[x]); classesLists.userDefenderOperators.Remove(rarityLists.threeStarOperators[x]); classesLists.userGuardOperators.Remove(rarityLists.threeStarOperators[x]); classesLists.userCasterOperators.Remove(rarityLists.threeStarOperators[x]); } break; } case "4*": { for (int x = 0; x < rarityLists.fourStarOperators.Count; x++) { listOfUserOps.Remove(rarityLists.fourStarOperators[x]); classesLists.userMedicOperators.Remove(rarityLists.fourStarOperators[x]); classesLists.userSupporterOperators.Remove(rarityLists.fourStarOperators[x]); classesLists.userSniperOperators.Remove(rarityLists.fourStarOperators[x]); classesLists.userVanguardOperators.Remove(rarityLists.fourStarOperators[x]); classesLists.userSpecialistOperators.Remove(rarityLists.fourStarOperators[x]); classesLists.userDefenderOperators.Remove(rarityLists.fourStarOperators[x]); classesLists.userGuardOperators.Remove(rarityLists.fourStarOperators[x]); classesLists.userCasterOperators.Remove(rarityLists.fourStarOperators[x]); } break; } case "5*": { for (int x = 0; x < rarityLists.fiveStarOperators.Count; x++) { listOfUserOps.Remove(rarityLists.fiveStarOperators[x]); classesLists.userMedicOperators.Remove(rarityLists.fiveStarOperators[x]); classesLists.userSupporterOperators.Remove(rarityLists.fiveStarOperators[x]); classesLists.userSniperOperators.Remove(rarityLists.fiveStarOperators[x]); classesLists.userVanguardOperators.Remove(rarityLists.fiveStarOperators[x]); classesLists.userSpecialistOperators.Remove(rarityLists.fiveStarOperators[x]); classesLists.userDefenderOperators.Remove(rarityLists.fiveStarOperators[x]); classesLists.userGuardOperators.Remove(rarityLists.fiveStarOperators[x]); classesLists.userCasterOperators.Remove(rarityLists.fiveStarOperators[x]); } break; } case "6*": { for (int x = 0; x < rarityLists.sixStarOperators.Count; x++) { listOfUserOps.Remove(rarityLists.sixStarOperators[x]); classesLists.userMedicOperators.Remove(rarityLists.sixStarOperators[x]); classesLists.userSupporterOperators.Remove(rarityLists.sixStarOperators[x]); classesLists.userSniperOperators.Remove(rarityLists.sixStarOperators[x]); classesLists.userVanguardOperators.Remove(rarityLists.sixStarOperators[x]); classesLists.userSpecialistOperators.Remove(rarityLists.sixStarOperators[x]); classesLists.userDefenderOperators.Remove(rarityLists.sixStarOperators[x]); classesLists.userGuardOperators.Remove(rarityLists.sixStarOperators[x]); classesLists.userCasterOperators.Remove(rarityLists.sixStarOperators[x]); } break; } } } }
public static void Filter_Out_Unselected_Classes_From_Pool_Of_UserOps(OperatorClassLists classesLists, List <string> listOfUserOps) { for (int i = 0; i < classesLists.classesToFilterOut.Count; i++) { switch (classesLists.classesToFilterOut[i]) { case "Medics": { for (int x = 0; x < classesLists.medicOperators.Count; x++) { listOfUserOps.Remove(classesLists.medicOperators[x]); classesLists.userMedicOperators.Remove(classesLists.medicOperators[x]); } break; } case "Supporters": { for (int x = 0; x < classesLists.supporterOperators.Count; x++) { listOfUserOps.Remove(classesLists.supporterOperators[x]); classesLists.userSupporterOperators.Remove(classesLists.supporterOperators[x]); } break; } case "Snipers": { for (int x = 0; x < classesLists.sniperOperators.Count; x++) { listOfUserOps.Remove(classesLists.sniperOperators[x]); classesLists.userSniperOperators.Remove(classesLists.sniperOperators[x]); } break; } case "Vanguards": { for (int x = 0; x < classesLists.vanguardOperators.Count; x++) { listOfUserOps.Remove(classesLists.vanguardOperators[x]); classesLists.userVanguardOperators.Remove(classesLists.vanguardOperators[x]); } break; } case "Specialists": { for (int x = 0; x < classesLists.specialistOperators.Count; x++) { listOfUserOps.Remove(classesLists.specialistOperators[x]); classesLists.userSpecialistOperators.Remove(classesLists.specialistOperators[x]); } break; } case "Defenders": { for (int x = 0; x < classesLists.defenderOperators.Count; x++) { listOfUserOps.Remove(classesLists.defenderOperators[x]); classesLists.userDefenderOperators.Remove(classesLists.defenderOperators[x]); } break; } case "Guards": { for (int x = 0; x < classesLists.guardOperators.Count; x++) { listOfUserOps.Remove(classesLists.guardOperators[x]); classesLists.userGuardOperators.Remove(classesLists.guardOperators[x]); } break; } case "Casters": { for (int x = 0; x < classesLists.casterOperators.Count; x++) { listOfUserOps.Remove(classesLists.casterOperators[x]); classesLists.userCasterOperators.Remove(classesLists.casterOperators[x]); } break; } default: { break; } } } }
public static void Roll_Ops_And_Create_Roster(int maxSquadSize) { int currentSquadSize = 1; List <string> rolledOps = Program.rolledOps; List <string> userOps = Program.userOps; List <string> potentialOpsToRoll = Program.potentialOpsToRoll; ListWiper.Wipe_Many_Lists_Clean(rolledOps, userOps, potentialOpsToRoll); UserOpsFileHandler.Read_UserOps_From_File(userOps); OperatorClassLists operatorClassLists = Program.operatorClassesLists; List <List <string> > listsToReset = new List <List <string> >() { operatorClassLists.userMedicOperators, operatorClassLists.userSupporterOperators, operatorClassLists.userSniperOperators, operatorClassLists.userVanguardOperators, operatorClassLists.userSpecialistOperators, operatorClassLists.userDefenderOperators, operatorClassLists.userGuardOperators, operatorClassLists.userCasterOperators }; List <List <string> > listsOfDefaults = new List <List <string> >() { operatorClassLists.defaultUserMedicOperators, operatorClassLists.defaultUserSupporterOperators, operatorClassLists.defaultUserSniperOperators, operatorClassLists.defaultUserVanguardOperators, operatorClassLists.defaultUserSpecialistOperators, operatorClassLists.defaultUserDefenderOperators, operatorClassLists.defaultUserGuardOperators, operatorClassLists.defaultUserCasterOperators }; for (int i = 0; i < listsOfDefaults.Count; i++) { ListResetter.Reset_A_List_To_Its_Default_Values(listsToReset[i], listsOfDefaults[i]); } OperatorRarityLists operatorRarityLists = Program.operatorRarityLists; ClassesFilter.Filter_Out_Unselected_Classes_From_Pool_Of_UserOps(operatorClassLists, userOps); RaritiesFilter.Filter_Out_Unselected_Rarities_From_Pool_Of_UserOps(operatorRarityLists, operatorClassLists, userOps); int medicLimit = Program.medicLimit; int supporterLimit = Program.supporterLimit; int sniperLimit = Program.sniperLimit; int vanguardLimit = Program.vanguardLimit; int specialistLimit = Program.specialistLimit; int defenderLimit = Program.defenderLimit; int guardLimit = Program.guardLimit; int casterLimit = Program.casterLimit; Random randomNumberGenerator = Program.randomNumberGenerator; PotentialOpsAdder.Add_Ops_To_Potential_List(medicLimit, operatorClassLists.userMedicOperators, randomNumberGenerator, potentialOpsToRoll); UserOpsClassRemover.Remove_Class_From_UserOps_List(medicLimit, userOps, operatorClassLists.userMedicOperators); PotentialOpsAdder.Add_Ops_To_Potential_List(supporterLimit, operatorClassLists.userSupporterOperators, randomNumberGenerator, potentialOpsToRoll); UserOpsClassRemover.Remove_Class_From_UserOps_List(supporterLimit, userOps, operatorClassLists.userSupporterOperators); PotentialOpsAdder.Add_Ops_To_Potential_List(sniperLimit, operatorClassLists.userSniperOperators, randomNumberGenerator, potentialOpsToRoll); UserOpsClassRemover.Remove_Class_From_UserOps_List(sniperLimit, userOps, operatorClassLists.userSniperOperators); PotentialOpsAdder.Add_Ops_To_Potential_List(vanguardLimit, operatorClassLists.userVanguardOperators, randomNumberGenerator, potentialOpsToRoll); UserOpsClassRemover.Remove_Class_From_UserOps_List(vanguardLimit, userOps, operatorClassLists.userVanguardOperators); PotentialOpsAdder.Add_Ops_To_Potential_List(specialistLimit, operatorClassLists.userSpecialistOperators, randomNumberGenerator, potentialOpsToRoll); UserOpsClassRemover.Remove_Class_From_UserOps_List(specialistLimit, userOps, operatorClassLists.userSpecialistOperators); PotentialOpsAdder.Add_Ops_To_Potential_List(defenderLimit, operatorClassLists.userDefenderOperators, randomNumberGenerator, potentialOpsToRoll); UserOpsClassRemover.Remove_Class_From_UserOps_List(defenderLimit, userOps, operatorClassLists.userDefenderOperators); PotentialOpsAdder.Add_Ops_To_Potential_List(guardLimit, operatorClassLists.userGuardOperators, randomNumberGenerator, potentialOpsToRoll); UserOpsClassRemover.Remove_Class_From_UserOps_List(guardLimit, userOps, operatorClassLists.userGuardOperators); PotentialOpsAdder.Add_Ops_To_Potential_List(casterLimit, operatorClassLists.userCasterOperators, randomNumberGenerator, potentialOpsToRoll); UserOpsClassRemover.Remove_Class_From_UserOps_List(casterLimit, userOps, operatorClassLists.userCasterOperators); currentSquadSize = PotentialOpsToRolledOpsAdder.Add_PotentialOps_List_To_List_Of_RolledOps_And_Increment_SquadSize(potentialOpsToRoll, rolledOps, currentSquadSize); PotentialOpsFromUserOpsRemover.Remove_PotentialOps_From_The_List_Of_UserOps(potentialOpsToRoll, userOps); RandomUserOpsToRolledOpsAdder.Add_RandomUserOps_To_List_Of_RolledOps(maxSquadSize, currentSquadSize, randomNumberGenerator, userOps, rolledOps); ListSorter.Sort_A_List_Alphabetically(rolledOps); }