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;
                }
                }
            }
        }
Esempio n. 2
0
        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);
        }