Esempio n. 1
0
 public void CopyFrom(Mine mine)
 {
     this._id = mine._id;
     this._playerId = mine._playerId;
     this._name = mine._name;
     this._mineType = mine._mineType;
     this._wood = mine._wood;
     this._mercury = mine._mercury;
     this._ore = mine._ore;
     this._sulfur = mine._sulfur;
     this._crystal = mine._crystal;
     this._gem = mine._gem;
     this._gold = mine._gold;
     this._description = mine._description;
 }
Esempio n. 2
0
        private static bool GetMineTypes(out Hashtable lst)
        {
            lst = new Hashtable();

            using (StreamReader sr = new StreamReader(string.Format(@"{0}\Data\MineType.txt", _appStartupPath)))
            {
                string strLine = "";
                strLine = sr.ReadLine();    // 1st line is column header

                while (!sr.EndOfStream)
                {
                    strLine = sr.ReadLine();

                    // id,name,w,m,o,s,c,g,gold,desc
                    string[] datas = strLine.Split(new char[] { ',' }, 10);

                    Mine dr = new Mine();
                    dr._id = System.Convert.ToInt32(datas[0]);
                    dr._name = datas[1];
                    dr._wood = System.Convert.ToInt32(datas[2]);
                    dr._mercury = System.Convert.ToInt32(datas[3]);
                    dr._ore = System.Convert.ToInt32(datas[4]);
                    dr._sulfur = System.Convert.ToInt32(datas[5]);
                    dr._crystal = System.Convert.ToInt32(datas[6]);
                    dr._gem = System.Convert.ToInt32(datas[7]);
                    dr._gold = System.Convert.ToInt32(datas[8]);
                    dr._description = datas[9];

                    lst.Add(dr._id, dr);
                }
            }

            return true;
        }