Exemple #1
0
        static void Main(string[] args)
        {
            // 1匹目
            Pekachu pekachu1 = new Pekachu("ぺかちゅう");

            pekachu1.ShowBaseName();
            pekachu1.ShowName();
            pekachu1.ShowSkill();


            // 2匹目
            Pekachu pekachu2 = new Pekachu("ぺかちゅう2号");

            pekachu2.ShowDetail();
        }
        /// <summary>
        /// 指定された番号のパチモンを生成
        /// </summary>
        /// <param name="no">番号</param>
        public Pachimon create(int no)
        {
            Pachimon pachimon = null;

            if (no == 1)
            {
                pachimon = new Pekachu();
            }

            if (no == 2)
            {
                pachimon = new Husigidana();
            }

            if (no == 3)
            {
                pachimon = new Dorugame();
            }

            return(pachimon);
        }