コード例 #1
0
ファイル: PokeCalc.cs プロジェクト: gemmyboy/Stuller_Backend
        }//End Output_PokemonData()

        //Output_TypeVsTypeData -: Pretty Prints Type vs Type data
        //Note: function called iteratively with bool flag to mark last iter
        private void Output_TypeVsTypeData(PokeApiNet.Type type, int iter, bool end)
        {
            if (iter == 0)
            {
                Console.WriteLine("---------------------------------------------------------");
                Console.WriteLine("| Pokemon Type: Strengths and Weaknesses Calculation    |");
                Console.WriteLine("|                                                       |");
            }

            string str_pokemontype = "| Type: ";
            string str_end         = "|";

            Console.WriteLine(str_pokemontype + new System.Globalization.CultureInfo("en-US", false).TextInfo.ToTitleCase(type.Name)
                              + (new string(' ', str_maxlength - str_pokemontype.Length - type.Name.Length - str_end.Length)) + str_end);

            string[] str_outputprefix =
            {
                "| Receives Double Damage from: ",
                "| Deals Double Damage to: ",
                "| Receives Half Damage from: ",
                "| Deals Half Damage to: ",
                "| Receives No Damage from: ",
                "| Deals No Damage to: ",
            };

            List <NamedApiResource <PokeApiNet.Type> >[] str_damagerelations =
            {
                type.DamageRelations.DoubleDamageFrom,
                type.DamageRelations.DoubleDamageTo,
                type.DamageRelations.HalfDamageFrom,
                type.DamageRelations.HalfDamageTo,
                type.DamageRelations.NoDamageFrom,
                type.DamageRelations.NoDamageTo,
            };

            //ASSERT just incase someone comes back to change this later and messes it up
            System.Diagnostics.Debug.Assert(str_outputprefix.Length == str_damagerelations.Length, "The number of damage relations must have of the same number output prefixes!");

            //There are 6 types of Damage Relations
            for (int t_iter_damagerelations = 0; t_iter_damagerelations < str_damagerelations.Length; t_iter_damagerelations++)
            {
                //There can be multiple types of each kind of Damage Relation
                for (int t_iter_relationtype = 0; t_iter_relationtype < str_damagerelations[t_iter_damagerelations].Count; t_iter_relationtype++)
                {
                    Console.WriteLine(str_outputprefix[t_iter_damagerelations]
                                      + new System.Globalization.CultureInfo("en-US", false).TextInfo.ToTitleCase(str_damagerelations[t_iter_damagerelations][t_iter_relationtype].Name)
                                      + (new string(' ',
                                                    str_maxlength - str_outputprefix[t_iter_damagerelations].Length - str_damagerelations[t_iter_damagerelations][t_iter_relationtype].Name.Length - str_end.Length))
                                      + str_end);
                } //End for - DamageRelation Type
            }     //End for - DamageRelation

            if (end)
            {
                Console.WriteLine("---------------------------------------------------------");
            }
        } //End Output_TypeVsTypeData()
コード例 #2
0
 private Brush SetTypeColor(Type type)
 {
     return(ColorDeclaration.FillTypeColorTextBoxes(type.Id));
 }
コード例 #3
0
 public Weakness(Type type, double multiplier)
 {
     Type       = type;
     Multiplier = multiplier;
 }