コード例 #1
0
        public static Pokémon GeneratorPokemon()
        {
            Pokémon randomPokemon = new Pokémon();
            Random  rand          = new Random();

            //generatorPokemonTotal++;

            string[] names = new string[5] {
                "random1", "random2", "random3", "random4", "random5"
            };
            string[] type = new string[5] {
                "gras", "electric", "water", "zand", "steen"
            };

            randomPokemon.Name                = names[rand.Next(0, 5)];
            randomPokemon.Number              = rand.Next(1, 100);
            randomPokemon.Type                = type[rand.Next(0, 5)];
            randomPokemon.HP_Base             = rand.Next(1, 101);
            randomPokemon.Attack_Base         = rand.Next(1, 101);
            randomPokemon.Defense_Base        = rand.Next(1, 101);
            randomPokemon.SpecialAttack_Base  = rand.Next(1, 101);
            randomPokemon.SpecialDefense_Base = rand.Next(1, 101);
            randomPokemon.Speed_Base          = rand.Next(1, 101);

            return(randomPokemon);
        }
コード例 #2
0
        static void Main(string[] args)
        {
            Pokémon pokemon;

            pokemon = Pokémon.GeneratorPokemon();
            Console.WriteLine(pokemon);
        }
コード例 #3
0
        public override bool Equals(object pokemon)
        {
            Pokémon pokemon1 = (Pokémon)pokemon;

            if (pokemon1.Name == Name && pokemon1.Level == Level && pokemon1.HP_Base == HP_Base && pokemon1.Attack_Base == Attack_Base && pokemon1.Defense_Base == Defense_Base && pokemon1.SpecialAttack_Base == SpecialAttack_Base && pokemon1.SpecialDefense_Base == SpecialDefense_Base && pokemon1.Speed_Base == Speed_Base)
            {
                return(true);
            }
            return(false);
        }