Beispiel #1
0
        /// <summary>
        /// CSVテキストから初期化
        /// </summary>
        /// <param name="type">CSVタイプ</param>
        /// <param name="text">CSVテキスト</param>
        public void InitFromCsvText(CsvType type, string text)
        {
/*			const string conmmaSeparatePattern  = @"(((?<x>(?=[,\r\n]+))|""(?<x>([^""]|"""")+)""|(?<x>[^,\r\n]+)),?)";
 *                      const string tabSeparatePattern = @"(((?<x>(?=[\t\r\n]+))|""(?<x>([^""]|"""")+)""|(?<x>[^\t\r\n]+))\t?)";
 *
 *                      string pattern;
 *                      switch(type)
 *                      {
 *                              case CsvType.Tsv:
 *                                      pattern = tabSeparatePattern;
 *                                      break;
 *                              case CsvType.Csv:
 *                              default:
 *                                      pattern = conmmaSeparatePattern;
 *                                      break;
 *                      }
 *                      strings = (
 *                              from System.Text.RegularExpressions.Match m
 *                                      in System.Text.RegularExpressions.Regex.Matches(text,
 *                                      pattern,
 *                                      System.Text.RegularExpressions.RegexOptions.ExplicitCapture)
 *                              select m.Groups[1].Value).ToArray();
 */
            this.strings      = text.Split(type == CsvType.Tsv ? '\t' : ',');
            this.isEmpty      = CheckEmpty();
            this.isCommentOut = CheckCommentOut();
        }
        /// <summary>
        /// CSVテキストから初期化
        /// </summary>
        /// <param name="type">CSVタイプ</param>
        /// <param name="text">CSVテキスト</param>
        public void InitFromCsvText(CsvType type, string text)
        {
            const string conmmaSeparatePattern = @"(((?<x>(?=[,\r\n]+))|""(?<x>([^""]|"""")+)""|(?<x>[^,\r\n]+)),?)";
            const string tabSeparatePattern    = @"(((?<x>(?=[\t\r\n]+))|""(?<x>([^""]|"""")+)""|(?<x>[^\t\r\n]+))\t?)";

            string pattern;

            switch (type)
            {
            case CsvType.Tsv:
                pattern = tabSeparatePattern;
                break;

            case CsvType.Csv:
            default:
                pattern = conmmaSeparatePattern;
                break;
            }
            strings = (
                from System.Text.RegularExpressions.Match m
                in System.Text.RegularExpressions.Regex.Matches(text,
                                                                pattern,
                                                                System.Text.RegularExpressions.RegexOptions.ExplicitCapture)
                select m.Groups[1].Value).ToArray();

            this.isEmpty = CheckEmpty();
        }
Beispiel #3
0
 public void InitFromCsvText(CsvType type, string text)
 {
     char[] separator = new char[] { (type != CsvType.Tsv) ? ',' : '\t' };
     this.strings      = text.Split(separator);
     this.isEmpty      = this.CheckEmpty();
     this.isCommentOut = this.CheckCommentOut();
 }
Beispiel #4
0
 public TrackingThresholdValue(AmazonLocale domainId, CsvType csvType, int thresholdValue, bool isDrop, int minDeltaAbsolute, int minDeltaPercentage, bool?deltasAreBetweenNotifications)
 {
     this.thresholdValue                = thresholdValue;
     this.isDrop                        = isDrop;
     this.domain                        = (byte)domainId;
     this.csvType                       = (int)csvType;
     this.minDeltaAbsolute              = minDeltaAbsolute;
     this.minDeltaPercentage            = minDeltaPercentage;
     this.deltasAreBetweenNotifications = deltasAreBetweenNotifications == null ? false : deltasAreBetweenNotifications;
 }
Beispiel #5
0
 public ExcelFile(string fileName, CsvType csvType)
 {
     this.rowColumnResolutionMethod      = MB.WinEIDrive.Excel.RowColumnResolutionMethod.RowOverColumn;
     this.groupMethodsAffectedCellsLimit = 0x2710;
     this.HashFactorA = 0x65;
     this.HashFactorB = 0x33;
     this.IDText      = "MB.WinEIDrive.Excel Free 2.3 for .NET 1.1, Version=23.1.5000.1000";
     this.Initialize();
     this.LoadCsv(fileName, csvType);
 }
Beispiel #6
0
        public void Init(string data, CsvType type)
        {
            data          = data.Replace("\n", "");
            lineArray     = data.Split("\r"[0]);
            dataDic       = new Dictionary <int, BassStruct>();
            itemNameArray = lineArray[0].Split("," [0]);
            for (int i = 1; i < lineArray.Length; i++)
            {
                Serialize(lineArray[i].Split("," [0]), type);
            }

            lineArray     = null;
            itemNameArray = null;
            stringData    = null;
        }
		void Create(string name, CsvType type, string csvText, int headerRow )
		{
			this.name = name;
			this.type = type;
			Rows.Clear();
			//CSVデータを作成
			string[] lines = csvText.Split("\n"[0]);
			for (int i = 0; i < lines.Length; i++)
			{
				StringGridRow row = new StringGridRow(GetThis, Rows.Count);
				row.InitFromCsvText(type,lines[i]);
				Rows.Add(row);
			}
			ParseHeader(headerRow);
			textLength = csvText.Length;
		}
 private void Create(string name, CsvType type, string csvText, int headerRow)
 {
     this.name = name;
     this.type = type;
     this.Rows.Clear();
     char[]   separator = new char[] { "\n"[0] };
     string[] strArray  = csvText.Split(separator);
     for (int i = 0; i < strArray.Length; i++)
     {
         StringGridRow item = new StringGridRow(this, this.Rows.Count);
         item.InitFromCsvText(type, strArray[i]);
         this.Rows.Add(item);
     }
     this.ParseHeader(headerRow);
     this.textLength = csvText.Length;
 }
Beispiel #9
0
 void Create(string name, CsvType type, string csvText, int headerRow)
 {
     this.name = name;
     this.type = type;
     Rows.Clear();
     //CSVデータを作成
     string[] lines = csvText.Split("\n"[0]);
     for (int i = 0; i < lines.Length; i++)
     {
         StringGridRow row = new StringGridRow(GetThis, Rows.Count);
         row.InitFromCsvText(type, lines[i]);
         Rows.Add(row);
     }
     ParseHeader(headerRow);
     textLength = csvText.Length;
 }
Beispiel #10
0
 void Create(string name, CsvType type, string csvText, int headerRow)
 {
     this.name = name;
     this.type = type;
     Rows.Clear();
     //CSVデータを作成
     string[] stringSeparators = new string[] { "\r\n", "\n" };
     string[] lines            = csvText.Split(stringSeparators, System.StringSplitOptions.None);
     for (int i = 0; i < lines.Length; i++)
     {
         StringGridRow row = new StringGridRow(this, Rows.Count);
         row.InitFromCsvText(type, lines[i]);
         Rows.Add(row);
     }
     ParseHeader(headerRow);
     textLength = csvText.Length;
 }
        public void WriteGamesToCsv(List<UnitTimeVector> games, string file, CsvType csvType)
        {
            if (games.Count == 0)
                return;

            if (csvType == CsvType.Excel)
            {
                CULTURE = "da-DK";
                SEPERATION_SYMBOL = ";";
            }
            else if (csvType == CsvType.Weka)
            {
                CULTURE = "en-US";
                SEPERATION_SYMBOL = ",";
            }

            using (StreamWriter sw = new StreamWriter(new FileStream(file, FileMode.Create)))
            {
                // Writes the CSV Header
                sw.Write("id" + SEPERATION_SYMBOL + "replay" + SEPERATION_SYMBOL);

                int counter = 0;
                foreach (KeyValuePair<string, int> unit in games[0].Vector)
                {
                    sw.Write(unit.Key);
                    if (counter != games[0].Vector.Count - 1)
                        sw.Write(SEPERATION_SYMBOL);
                    counter++;
                }
                sw.WriteLine("");

                // Writes the CSV body
                for (int i = 0; i < games.Count; i++)
                {
                    WriteGameToCsv(games[i], i, sw);
                }
            }
        }
Beispiel #12
0
        ///<overloads>Saves all data to a new file in CSV format.</overloads>
        ///<summary>
        ///Saves all data to a new file in a specified CSV format.
        ///</summary>
        ///<param name="fileName">File name.</param>
        ///<param name="csvType">CSV type.</param>
        public void SaveCsv(string fileName, CsvType csvType)
        {
            switch (csvType)
            {
            case CsvType.CommaDelimited:
            {
                this.SaveCsv(fileName, ',');
                return;
            }

            case CsvType.SemicolonDelimited:
            {
                this.SaveCsv(fileName, ';');
                return;
            }

            case CsvType.TabDelimited:
            {
                this.SaveCsv(fileName, '\t');
                return;
            }
            }
            throw new Exception("Internal: Unknown CsvType.");
        }
Beispiel #13
0
 void Serialize(string[] lineData, CsvType type)
 {
     /*
      * if(itemNameArray.Length != lineData.Length){
      *      debug.GetInstance().Warmming("csv data warmming:" + lineData);
      *      return  ;
      * }
      *
      * stringData = "{" ;
      * for(int i = 0; i < itemNameArray.Length ; ++ i){
      *      stringData += '"' + itemNameArray[i] + '"' ;
      *      stringData += ':' ;
      *      //is char
      *      try{
      *              float.Parse(lineData[i]);
      *              stringData += lineData[i] ;
      *      }
      *      catch{
      *              stringData += '"' ;
      *              stringData += lineData[i] ;
      *              stringData += '"' ;
      *      }
      *
      *      //stringData += lineData[i] ;
      *      stringData += ',';
      * }
      * stringData += "}" ;
      *
      * Dictionary<string,object> typeData = (Dictionary<string,object>)Json.Deserialize(stringData);
      * //TYPE type = new TYPE(typeData);
      * switch(type){
      * case CsvType.CSV_TYPE_PLAYER:{
      *      PlayerMoudleData data = new PlayerMoudleData(typeData);
      *      dataDic.Add(data.id,data);
      * }
      *      break ;
      *
      *      //monster
      * case CsvType.CSV_TYPE_MONSTER:{
      *      MonsterMoudleData data = new MonsterMoudleData(typeData);
      *      string str = typeData["beSkillList"] as string;
      *      string[] reslut ;
      *      if(str != null){
      *              reslut = str.Split('#');
      *              for(int i = 0; i<reslut.Length; ++i){
      *                      try{
      *                              int id = int.Parse(reslut[i]);
      *                              data.beSkillList.Add(id);
      *                      }
      *                      catch{
      *
      *                      }
      *              }
      *      }
      *
      *
      *      str = typeData["skillList"] as string;
      *      if(str != null){
      *              reslut = str.Split('#');
      *              for(int i = 0; i<reslut.Length; ++i){
      *                      try{
      *                              int id = int.Parse(reslut[i]);
      *                              data.skillList.Add(id);
      *                      }
      *                      catch{
      *
      *                      }
      *              }
      *      }
      *
      *      str = typeData["skillProbabilityList"] as string;
      *      if(str != null){
      *              reslut = str.Split('#');
      *              for(int i = 0; i<reslut.Length; ++i){
      *                      try{
      *                              int id = int.Parse(reslut[i]);
      *                              data.skillProbabilityList.Add(id);
      *                      }
      *                      catch{
      *
      *                      }
      *              }
      *      }
      *
      *      str = typeData["talkIDInMove"] as string;
      *      if(str != null){
      *              reslut = str.Split('#');
      *              for(int i = 0; i<reslut.Length; ++i){
      *                      try{
      *                              int id = int.Parse(reslut[i]);
      *                              data.talkIDInMove.Add(id);
      *                      }
      *                      catch{
      *
      *                      }
      *              }
      *      }
      *
      *      str = typeData["talkLvInMove"] as string;
      *      if(str != null){
      *              reslut = str.Split('#');
      *              for(int i = 0; i<reslut.Length; ++i){
      *                      try{
      *                              int id = int.Parse(reslut[i]);
      *                              data.talkLvInMove.Add(id);
      *                      }
      *                      catch{
      *
      *                      }
      *              }
      *      }
      *      str = typeData["talkIDInSpeed"] as string;
      *      if(str != null){
      *              reslut = str.Split('#');
      *              for(int i = 0; i<reslut.Length; ++i){
      *                      try{
      *                              int id = int.Parse(reslut[i]);
      *                              data.talkIDInSpeed.Add(id);
      *                      }
      *                      catch{
      *
      *                      }
      *              }
      *      }
      *      str = typeData["talkLvInSpeed"] as string;
      *      if(str != null){
      *              reslut = str.Split('#');
      *              for(int i = 0; i<reslut.Length; ++i){
      *                      try{
      *                              int id = int.Parse(reslut[i]);
      *                              data.talkLvInSpeed.Add(id);
      *                      }
      *                      catch{
      *
      *                      }
      *              }
      *      }
      *      str = typeData["talkIDInAttack"] as string;
      *      if(str != null){
      *              reslut = str.Split('#');
      *              for(int i = 0; i<reslut.Length; ++i){
      *                      try{
      *                              int id = int.Parse(reslut[i]);
      *                              data.talkIDInAttack.Add(id);
      *                      }
      *                      catch{
      *
      *                      }
      *              }
      *      }
      *      str = typeData["talkLvInAttack"] as string;
      *      if(str != null){
      *              reslut = str.Split('#');
      *              for(int i = 0; i<reslut.Length; ++i){
      *                      try{
      *                              int id = int.Parse(reslut[i]);
      *                              data.talkLvInAttack.Add(id);
      *                      }
      *                      catch{
      *
      *                      }
      *              }
      *      }
      *      str = typeData["talkIDInRobWomen"] as string;
      *      if(str != null){
      *              reslut = str.Split('#');
      *              for(int i = 0; i<reslut.Length; ++i){
      *                      try{
      *                              int id = int.Parse(reslut[i]);
      *                              data.talkIDInRobWomen.Add(id);
      *                      }
      *                      catch{
      *
      *                      }
      *              }
      *      }
      *      str = typeData["talkLvInRobWomen"] as string;
      *      if(str != null){
      *              reslut = str.Split('#');
      *              for(int i = 0; i<reslut.Length; ++i){
      *                      try{
      *                              int id = int.Parse(reslut[i]);
      *                              data.talkLvInRobWomen.Add(id);
      *                      }
      *                      catch{
      *
      *                      }
      *              }
      *      }
      *      str = typeData["talkIDInRobDoor"] as string;
      *      if(str != null){
      *              reslut = str.Split('#');
      *              for(int i = 0; i<reslut.Length; ++i){
      *                      try{
      *                              int id = int.Parse(reslut[i]);
      *                              data.talkIDInRobDoor.Add(id);
      *                      }
      *                      catch{
      *
      *                      }
      *              }
      *      }
      *      str = typeData["talkLvInRobDoor"] as string;
      *      if(str != null){
      *              reslut = str.Split('#');
      *              for(int i = 0; i<reslut.Length; ++i){
      *                      try{
      *                              int id = int.Parse(reslut[i]);
      *                              data.talkLvInRobDoor.Add(id);
      *                      }
      *                      catch{
      *
      *                      }
      *              }
      *      }
      *      str = typeData["talkIDInDie"] as string;
      *      if(str != null){
      *              reslut = str.Split('#');
      *              for(int i = 0; i<reslut.Length; ++i){
      *                      try{
      *                              int id = int.Parse(reslut[i]);
      *                              data.talkIDInDie.Add(id);
      *                      }
      *                      catch{
      *
      *                      }
      *              }
      *      }
      *      str = typeData["talkLvInDie"] as string;
      *      if(str != null){
      *              reslut = str.Split('#');
      *              for(int i = 0; i<reslut.Length; ++i){
      *                      try{
      *                              int id = int.Parse(reslut[i]);
      *                              data.talkLvInDie.Add(id);
      *                      }
      *                      catch{
      *
      *                      }
      *              }
      *      }
      *      str = typeData["talkIDInDead"] as string;
      *      if(str != null){
      *              reslut = str.Split('#');
      *              for(int i = 0; i<reslut.Length; ++i){
      *                      try{
      *                              int id = int.Parse(reslut[i]);
      *                              data.talkIDInDead.Add(id);
      *                      }
      *                      catch{
      *
      *                      }
      *              }
      *      }
      *      str = typeData["talkLvInDead"] as string;
      *      if(str != null){
      *              reslut = str.Split('#');
      *              for(int i = 0; i<reslut.Length; ++i){
      *                      try{
      *                              int id = int.Parse(reslut[i]);
      *                              data.talkLvInDead.Add(id);
      *                      }
      *                      catch{
      *
      *                      }
      *              }
      *      }
      *      str = typeData["talkIDInSkill"] as string;
      *      if(str != null){
      *              reslut = str.Split('#');
      *              for(int i = 0; i<reslut.Length; ++i){
      *                      try{
      *                              int id = int.Parse(reslut[i]);
      *                              data.talkIDInSkill.Add(id);
      *                      }
      *                      catch{
      *
      *                      }
      *              }
      *      }
      *      str = typeData["talkLvInSkill"] as string;
      *      if(str != null){
      *              reslut = str.Split('#');
      *              for(int i = 0; i<reslut.Length; ++i){
      *                      try{
      *                              int id = int.Parse(reslut[i]);
      *                              data.talkLvInSkill.Add(id);
      *                      }
      *                      catch{
      *
      *                      }
      *              }
      *      }
      *
      *      //attack area & eye shot area & attack lock count
      *      if(data.profession == 11){
      *              data.attackArea = 150;
      *              data.eyeShotArea= 600;
      *              data.attackLockCount = 1 ;
      *      }
      *      else if(data.profession == 12){
      *              data.attackArea = 150;
      *              data.eyeShotArea= 450;
      *              data.attackLockCount = 2 ;
      *      }
      *      else if(data.profession == 13){
      *              data.attackArea = 350;
      *              data.eyeShotArea= 550;
      *              data.attackLockCount = 1 ;
      *      }
      *      else if(data.profession == 14){
      *              data.attackArea = 300;
      *              data.eyeShotArea= 550;
      *              data.attackLockCount = 1 ;
      *      }
      *
      *      if(dataDic.ContainsKey(data.ID))
      *      {
      *              debug.GetInstance().Error("monster moudle data have same id:" + data.ID);
      *      }
      *      else{
      *              dataDic.Add(data.ID,data);
      *      }
      * }
      *      break ;
      *
      * case CsvType.CSV_TYPE_PET:
      * {
      *      PetMoudleData data = new PetMoudleData(typeData);
      *      string str = typeData["heavy"] as string;
      *      string[] reslut ;
      *      /*if(str != null){
      *              reslut = str.Split('#');
      *              for(int i = 0; i<reslut.Length; ++i){
      *                      try{
      *                              int id = int.Parse(reslut[i]);
      *                              data.heavy.Add(id);
      *                      }
      *                      catch{
      *
      *                      }
      *              }
      *      }
      *
      *
      *      str = typeData["dodge"] as string;
      *      if(str != null){
      *              reslut = str.Split('#');
      *              for(int i = 0; i<reslut.Length; ++i){
      *                      try{
      *                              int id = int.Parse(reslut[i]);
      *                              data.dodge.Add(id);
      *                      }
      *                      catch{
      *
      *                      }
      *              }
      *      }
      *
      *      str = typeData["talkIDInSleep"] as string;
      *      if(str != null){
      *              reslut = str.Split('#');
      *              for(int i = 0; i<reslut.Length; ++i){
      *                      try{
      *                              int id = int.Parse(reslut[i]);
      *                              data.talkIDInSleep.Add(id);
      *                      }
      *                      catch{
      *
      *                      }
      *              }
      *      }
      *      str = typeData["talkLvInSleep"] as string;
      *      if(str != null){
      *              reslut = str.Split('#');
      *              for(int i = 0; i<reslut.Length; ++i){
      *                      try{
      *                              int id = int.Parse(reslut[i]);
      *                              data.talkLvInSleep.Add(id);
      *                      }
      *                      catch{
      *
      *                      }
      *              }
      *      }
      *      str = typeData["talkIDInSpeed"] as string;
      *      if(str != null){
      *              reslut = str.Split('#');
      *              for(int i = 0; i<reslut.Length; ++i){
      *                      try{
      *                              int id = int.Parse(reslut[i]);
      *                              data.talkIDInSpeed.Add(id);
      *                      }
      *                      catch{
      *
      *                      }
      *              }
      *      }
      *      str = typeData["talkLvInSpeed"] as string;
      *      if(str != null){
      *              reslut = str.Split('#');
      *              for(int i = 0; i<reslut.Length; ++i){
      *                      try{
      *                              int id = int.Parse(reslut[i]);
      *                              data.talkLvInSpeed.Add(id);
      *                      }
      *                      catch{
      *
      *                      }
      *              }
      *      }
      *      str = typeData["talkIDInAttack"] as string;
      *      if(str != null){
      *              reslut = str.Split('#');
      *              for(int i = 0; i<reslut.Length; ++i){
      *                      try{
      *                              int id = int.Parse(reslut[i]);
      *                              data.talkIDInAttack.Add(id);
      *                      }
      *                      catch{
      *
      *                      }
      *              }
      *      }
      *      str = typeData["talkLvInAttack"] as string;
      *      if(str != null){
      *              reslut = str.Split('#');
      *              for(int i = 0; i<reslut.Length; ++i){
      *                      try{
      *                              int id = int.Parse(reslut[i]);
      *                              data.talkLvInAttack.Add(id);
      *                      }
      *                      catch{
      *
      *                      }
      *              }
      *      }
      *      str = typeData["talkIDInDie"] as string;
      *      if(str != null){
      *              reslut = str.Split('#');
      *              for(int i = 0; i<reslut.Length; ++i){
      *                      try{
      *                              int id = int.Parse(reslut[i]);
      *                              data.talkIDInDie.Add(id);
      *                      }
      *                      catch{
      *
      *                      }
      *              }
      *      }
      *      str = typeData["talkLvInDie"] as string;
      *      if(str != null){
      *              reslut = str.Split('#');
      *              for(int i = 0; i<reslut.Length; ++i){
      *                      try{
      *                              int id = int.Parse(reslut[i]);
      *                              data.talkLvInDie.Add(id);
      *                      }
      *                      catch{
      *
      *                      }
      *              }
      *      }
      *      str = typeData["talkIDInDead"] as string;
      *      if(str != null){
      *              reslut = str.Split('#');
      *              for(int i = 0; i<reslut.Length; ++i){
      *                      try{
      *                              int id = int.Parse(reslut[i]);
      *                              data.talkIDInDead.Add(id);
      *                      }
      *                      catch{
      *
      *                      }
      *              }
      *      }
      *      str = typeData["talkLvInDead"] as string;
      *      if(str != null){
      *              reslut = str.Split('#');
      *              for(int i = 0; i<reslut.Length; ++i){
      *                      try{
      *                              int id = int.Parse(reslut[i]);
      *                              data.talkLvInDead.Add(id);
      *                      }
      *                      catch{
      *
      *                      }
      *              }
      *      }
      *      str = typeData["talkIDInSkill"] as string;
      *      if(str != null){
      *              reslut = str.Split('#');
      *              for(int i = 0; i<reslut.Length; ++i){
      *                      try{
      *                              int id = int.Parse(reslut[i]);
      *                              data.talkIDInSkill.Add(id);
      *                      }
      *                      catch{
      *
      *                      }
      *              }
      *      }
      *      str = typeData["talkLvInSkill"] as string;
      *      if(str != null){
      *              reslut = str.Split('#');
      *              for(int i = 0; i<reslut.Length; ++i){
      *                      try{
      *                              int id = int.Parse(reslut[i]);
      *                              data.talkLvInSkill.Add(id);
      *                      }
      *                      catch{
      *
      *                      }
      *              }
      *      }
      *
      *      //attack area & eye shot area & attack lock count
      *      if(data.profession == 11){
      *              data.attackArea = 150;
      *              data.eyeShotArea= 600;
      *              data.attackLockCount = 1 ;
      *      }
      *      else if(data.profession == 12){
      *              data.attackArea = 150;
      *              data.eyeShotArea= 450;
      *              data.attackLockCount = 2 ;
      *      }
      *      else if(data.profession == 13){
      *              data.attackArea = 350;
      *              data.eyeShotArea= 550;
      *              data.attackLockCount = 1 ;
      *      }
      *      else if(data.profession == 14){
      *              data.attackArea = 300;
      *              data.eyeShotArea= 550;
      *              data.attackLockCount = 1 ;
      *      }
      *
      *      if(dataDic.ContainsKey(data.ID))
      *      {
      *              debug.GetInstance().Error("pet moudle data have same id:" + data.ID);
      *      }
      *      else{
      *              dataDic.Add(data.ID,data);
      *      }
      * }
      *      break;
      * case CsvType.CSV_TYPE_TALK:{
      *      TalkMoudleDate data = new TalkMoudleDate(typeData);
      *      if(dataDic.ContainsKey(data.ID))
      *      {
      *              debug.GetInstance().Error("talk moudle data have same id:" + data.ID);
      *      }
      *      else{
      *              dataDic.Add(data.ID,data);
      *      }
      * }
      *      break;
      * case CsvType.CSV_TYPE_SKILLLV:{
      *      SkillLvMoudleData data = new SkillLvMoudleData(typeData);
      *
      *      string str = typeData["skillLvList"] as string;
      *      string[] reslut ;
      *      if(str != null){
      *              reslut = str.Split('#');
      *              for(int i = 0; i<reslut.Length; ++i){
      *                      try{
      *                              int id = int.Parse(reslut[i]);
      *                              data.skillLvList.Add(id);
      *                      }
      *                      catch{
      *
      *                      }
      *              }
      *      }
      *
      *      if(dataDic.ContainsKey(data.ID))
      *      {
      *              debug.GetInstance().Error("skill level moudle data have same id:" + data.ID);
      *      }
      *      else{
      *              dataDic.Add(data.ID,data);
      *      }
      * }
      *      break ;
      *      //resouce
      * case CsvType.CSV_TYPE_RESOUCE:{
      *      ResourceMoudleData data = new ResourceMoudleData(typeData);
      *      if(dataDic.ContainsKey(data.ID))
      *      {
      *              debug.GetInstance().Error("resource moudle data have same id:" + data.ID);
      *      }
      *      else{
      *              dataDic.Add(data.ID,data);
      *      }
      * }
      *      break ;
      *
      *      //dictionary
      * case CsvType.CSV_TYPE_DICTIONARY:{
      *      DictionaryData data = new DictionaryData(typeData);
      *      if(dataDic.ContainsKey(data.id))
      *      {
      *              debug.GetInstance().Error("dictionary moudle data have same id:" + data.id);
      *      }
      *      else{
      *              dataDic.Add(data.id,data);
      *      }
      * }
      *      break ;
      *
      *      //skill
      * case CsvType.CSV_TYPE_SKILL:{
      *      SkillMoudleData data = new SkillMoudleData(typeData);
      *      if(data.costType == 1){
      *              string str = (string)typeData["cost"] ;
      *              string[] reslut = str.Split('#') ;
      *              data.greenStone = int.Parse(reslut[0]) ;
      *              data.blueStone  = int.Parse(reslut[1]) ;
      *              data.redStone   = int.Parse(reslut[2]) ;
      *      }
      *      else{
      *              string str = (string)typeData["cost"] ;
      *              string[] reslut = str.Split('#') ;
      *              data.magic = int.Parse(reslut[0]) ;
      *      }
      *
      *      string effectIdStr = (string)typeData["effectID"] ;
      *      string[] effectIDList = effectIdStr.Split('#');
      *      for(int i = 0; i<effectIDList.Length; ++i){
      *              if(effectIDList[i] != ""){
      *                      data.effectID.Add(int.Parse(effectIDList[i]));
      *              }
      *      }
      *
      *      string buffIDStr = (string)typeData["buffer"] ;
      *      string[] buffIDList= buffIDStr.Split('#');
      *      for(int i = 0; i<buffIDList.Length; ++i){
      *              if(buffIDList[i] != ""){
      *                      data.buffer.Add(int.Parse(buffIDList[i]));
      *              }
      *      }
      *
      *      string buffRateStr = (string)typeData["buffRate"] ;
      *      string[] buffRateList= buffRateStr.Split('#');
      *      for(int i = 0; i<buffRateList.Length; ++i){
      *              if(buffRateList[i] != ""){
      *                      data.buffRate.Add(int.Parse(buffRateList[i]));
      *              }
      *      }
      *
      *      if(dataDic.ContainsKey(data.id))
      *      {
      *              debug.GetInstance().Error("skill moudle data have same id:" + data.id);
      *      }
      *      else{
      *              dataDic.Add(data.id,data);
      *      }
      * }
      *      break ;
      *
      *      //buff
      * case CsvType.CSV_TYPE_BUFF:{
      *      BuffMoudleData data = new BuffMoudleData(typeData);
      *      if(dataDic.ContainsKey(data.id))
      *      {
      *              debug.GetInstance().Error("buff moudle data have same id:" + data.id);
      *      }
      *      else{
      *              dataDic.Add(data.id,data);
      *      }
      * }
      *      break ;
      *
      *      //item
      * case CsvType.CSV_TYPE_ITEM:{
      *      ItemMoudleData data = new ItemMoudleData(typeData);
      *      if(dataDic.ContainsKey(data.ID))
      *      {
      *              debug.GetInstance().Error("item moudle data have same id:" + data.ID);
      *      }
      *      else{
      *              dataDic.Add(data.ID,data);
      *      }
      * }
      *      break ;
      *
      * case CsvType.CSV_TYPE_TASK:{
      *      TaskMoudleData data = new TaskMoudleData(typeData);
      *
      *      string buffRateStr = (string)typeData["taskInfoId"] ;
      *      string[] buffRateList= buffRateStr.Split('#');
      *      for(int i = 0; i<buffRateList.Length; ++i){
      *              if(buffRateList[i] != ""){
      *                      data.taskInfoId = int.Parse(buffRateList[i]);
      *              }
      *      }
      *
      *      buffRateStr = (string)typeData["getTaskId"] ;
      *      buffRateList= buffRateStr.Split('#');
      *      for(int i = 0; i<buffRateList.Length; ++i){
      *              if(buffRateList[i] != ""){
      *                      data.getTaskId = int.Parse(buffRateList[i]);
      *              }
      *      }
      *
      *      buffRateStr = (string)typeData["setTaskTalkId"] ;
      *      buffRateList= buffRateStr.Split('#');
      *      for(int i = 0; i<buffRateList.Length; ++i){
      *              if(buffRateList[i] != ""){
      *                      data.setTaskTalkId.Add(int.Parse(buffRateList[i]));
      *              }
      *      }
      *
      *      buffRateStr = (string)typeData["attackNpcTalkId"] ;
      *      buffRateList= buffRateStr.Split('#');
      *      for(int i = 0; i<buffRateList.Length; ++i){
      *              if(buffRateList[i] != ""){
      *                      data.attackNpcTalkId.Add(int.Parse(buffRateList[i]));
      *              }
      *      }
      *
      *      buffRateStr = (string)typeData["unfilTaskTalkId"] ;
      *      buffRateList= buffRateStr.Split('#');
      *      for(int i = 0; i<buffRateList.Length; ++i){
      *              if(buffRateList[i] != ""){
      *                      data.unfilTaskTalkId.Add(int.Parse(buffRateList[i]));
      *              }
      *      }
      *
      *      buffRateStr = (string)typeData["filTaskTalkId"] ;
      *      buffRateList= buffRateStr.Split('#');
      *      for(int i = 0; i<buffRateList.Length; ++i){
      *              if(buffRateList[i] != ""){
      *                      data.filTaskTalkId.Add(int.Parse(buffRateList[i]));
      *              }
      *      }
      *
      *      buffRateStr = (string)typeData["npcResId"] ;
      *      buffRateList= buffRateStr.Split('#');
      *      data.npcResId = "";
      *
      *
      *      if(dataDic.ContainsKey(data.id))
      *      {
      *              //debug.GetInstance().Error("task moudle data have same id:" + data.id);
      *      }
      *      else{
      *              dataDic.Add(data.id,data);
      *      }
      *
      *      }
      *      break;
      *      case CsvType.CSV_TYPE_EXPUPGRADE:{
      *      //ExpUpGradeMoudleData data = new ExpUpGradeMoudleData(typeData);
      *      //dataDic.Add(data.ID,data);
      *      }
      *      break ;
      * }*/
 }
 /// <summary>
 /// コンストラクタ
 /// </summary>
 /// <param name="name">名前</param>
 public StringGrid(string name, CsvType type)
 {
     this.name = name;
     this.type = type;
 }
Beispiel #15
0
 public void LoadCsv(Stream stream, CsvType csvType)
 {
     this.LoadCsv(stream, csvTypeDelimiters[(int)csvType]);
 }
Beispiel #16
0
        public BassStruct GetData(int id, CsvType type)
        {
            BassStruct reuslt = new BassStruct();

            return(reuslt);
        }
Beispiel #17
0
 /// <summary>
 /// コンストラクタ
 /// </summary>
 /// <param name="name">名前</param>
 public StringGrid(string name, CsvType type, string csvText, int headerRow)
 {
     Create(name, type, csvText, headerRow);
 }
Beispiel #18
0
 public void SaveCsv(Stream stream, CsvType csvType)
 {
     this.SaveCsv(stream, csvTypeDelimiters[(int)csvType]);
 }
		public StringGrid(string name, CsvType type, string csvText )
		{
			Create( name, type, csvText, 0);
		}
		/// <summary>
		/// コンストラクタ
		/// </summary>
		/// <param name="name">名前</param>
		public StringGrid(string name, CsvType type, string csvText, int headerRow )
		{
			Create( name, type, csvText, headerRow);
		}
		/// <summary>
		/// コンストラクタ
		/// </summary>
		/// <param name="name">名前</param>
		public StringGrid(string name, CsvType type)
		{
			this.name = name;
			this.type = type;
		}
Beispiel #22
0
 public void SaveCsv(StreamWriter sw, CsvType csvType)
 {
     this.SaveCsv(sw, csvTypeDelimiters[(int)csvType]);
 }
Beispiel #23
0
 public void LoadCsv(StreamReader sr, CsvType csvType)
 {
     this.LoadCsv(sr, csvTypeDelimiters[(int)csvType]);
 }
Beispiel #24
0
 /// <summary>
 /// コンストラクタ
 /// </summary>
 /// <param name="name">名前</param>
 public StringGrid(string name, string sheetName, CsvType type)
 {
     this.name      = name;
     this.sheetName = sheetName;
     this.type      = type;
 }
Beispiel #25
0
 public TrackingNotifyIf(AmazonLocale domainId, CsvType csvType, NotifyIfType notifyIfType)
 {
     this.domain       = (byte)domainId;
     this.csvType      = (int)csvType;
     this.notifyIfType = (int)notifyIfType;
 }
Beispiel #26
0
 public StringGrid(string name, CsvType type, string csvText)
 {
     Create(name, type, csvText, 0);
 }
Beispiel #27
0
 public void SaveCsv(string fileName, CsvType csvType)
 {
     this.SaveCsv(fileName, csvTypeDelimiters[(int)csvType]);
 }
Beispiel #28
0
 /// <summary>
 /// CSVテキストから初期化
 /// </summary>
 /// <param name="type">CSVタイプ</param>
 /// <param name="text">CSVテキスト</param>
 public void InitFromCsvText(CsvType type, string text)
 {
     this.strings      = text.Split(type == CsvType.Tsv ? '\t' : ',');
     this.isEmpty      = CheckEmpty();
     this.isCommentOut = CheckCommentOut();
 }
Beispiel #29
0
        /// <summary>
        /// CSVデータロード
        /// </summary>
        /// <param name="csvFileFullPath"></param>
        /// <returns></returns>
        public List <CsvEntity> Load(string csvFileFullPath, CsvType csvType = CsvType.Fleet)
        {
            var result = new List <CsvEntity>();

            using (var reader = new StreamReader(csvFileFullPath))
            {
                using (var csv = new CsvReader(reader, CultureInfo.InvariantCulture))
                {
                    csv.Read();
                    csv.ReadHeader();

                    switch (csvType)
                    {
                    case CsvType.Fleet:

                        while (csv.Read())
                        {
                            var record = new CsvEntity
                            {
                                /*
                                 * Field1 = csv.GetField("乗車 ID"),
                                 * Field2 = csv.GetField("料金")
                                 */
                                ID     = csv.GetField("tripUUID"),
                                Date   = csv.GetField("timestamp") /*.Substring(0, 10)*/,
                                Amount = csv.GetField("amount"),
                                Type   = csv.GetField("itemType")
                            };
                            result.Add(record);
                        }
                        break;

                    case CsvType.Normal:
                        //未実装
                        break;

                    case CsvType.RawDB:
                        while (csv.Read())
                        {
                            var record = new CsvEntity
                            {
                                /*
                                 * Field1 = csv.GetField("乗車 ID"),
                                 * Field2 = csv.GetField("料金")
                                 */
                                ID     = csv.GetField("ID"),
                                Date   = csv.GetField("Date"),
                                Amount = csv.GetField("Amount"),
                                Type   = csv.GetField("Type")
                            };
                            result.Add(record);
                        }
                        break;

                    default:
                        break;
                    }
                }
                return(result);
            }
        }