using System;
using System.Collections.Generic;
using DxLibDLL;
using System.Collections;
using System.IO;


namespace HH
{
    class GameTable
    {

        Hashtable list;

        public GameTable() ///////////////// 大問題。スタティックコンストラクタがとヴした?
        {
            this.list = new Hashtable() ;

            /*
            // ファイルからテキストを読み出し。
            using (StreamReader sr = new StreamReader(@"GameTable.txt"))
            {
                string line = "";
                string line1 = "";
                string line2 = "";
                string line3 = "";
                string line4 = "";

                line = sr.ReadLine();
                while (line != null) 
                {
                    
                    if (line.StartsWith(@"//") == false)
                    {
                        line1 = line;          // index
                        line2 = sr.ReadLine(); // kind
                        //line3 = sr.ReadLine(); // x
                        //line4 = sr.ReadLine(); // y



                        Enemy.Type m;

                        //EnemySample e = new EnemySample();

                        //this.list[Int32.Parse(line1)] = 

                        // kind
                        m = (Enemy.Type)Enum.Parse(typeof(HH.Enemy.Type), line2);

                        Enemy tmp; //= new Enemy();

                        switch (m)
                        {

                            case Enemy.Type.EnemySample:
                                //tmp = new EnemyMissile(); break; /////////////  実験中

                            default:
                                tmp = new EnemyMissile(); break;
                        }
                       
              

                        // position x y coordinate
                        tmp.position = new Vector(double.Parse(line3), double.Parse(line4));


                //        this.list[Int32.Parse(line1)] = tmp;
                    }//endif
                    line = sr.ReadLine();
                }//while
            }//using


            //EnemySample e = new EnemySample();
             * 
             */
             
        }//constructor

        public CBasic this[int index]
        {
            get
            {
                if (list[index] != null)
                {
                    return (CBasic)list[index];

                    
                }

                return null;
            }
        
        }
    }
}
