コード例 #1
0
ファイル: TestCode.cs プロジェクト: JSandusky/CastleDBGen
 public void Load(JObject file)
 {
     JArray sheetsElem = file.Property("sheets").Value as JArray;
     for (int i = 0; i < sheetsElem.Count; ++i) {
     JObject sheet = sheetsElem[i] as JObject;
     string sheetName = sheet.Property("name").Value.ToString();
     if (sheetName.Equals("Test")) {
         JArray linesElem = sheet.Property("lines").Value as JArray;
         for (int j = 0; j < linesElem.Count; ++j) {
             Test val = new Test();
             val.Load(linesElem[j] as JObject);
             TestList.Add(val);
         }
     }
     else if (sheetName.Equals("SecondSheet")) {
         JArray linesElem = sheet.Property("lines").Value as JArray;
         for (int j = 0; j < linesElem.Count; ++j) {
             SecondSheet val = new SecondSheet();
             val.Load(linesElem[j] as JObject);
             SecondSheetList.Add(val);
         }
     }
     }
     for (int i = 0; i < TestList.Count; ++i)
     TestList[i].ResolveReferences(this);
     for (int i = 0; i < SecondSheetList.Count; ++i)
     SecondSheetList[i].ResolveReferences(this);
 }
コード例 #2
0
ファイル: TestCode.cs プロジェクト: zenithght/CastleDBGen
 public void ResolveReferences(MyDB db)
 {
     for (int i = 0; i < db.SecondSheetList.Count; ++i)
     {
         if (db.SecondSheetList[i].ID.Equals(NewRefTestKey))
         {
             NewRefTest = db.SecondSheetList[i];
             break;
         }
     }
 }
コード例 #3
0
ファイル: TestCode.cs プロジェクト: zenithght/CastleDBGen
        public void Load(JObject file)
        {
            JArray sheetsElem = file.Property("sheets").Value as JArray;

            for (int i = 0; i < sheetsElem.Count; ++i)
            {
                JObject sheet     = sheetsElem[i] as JObject;
                string  sheetName = sheet.Property("name").Value.ToString();
                if (sheetName.Equals("Test"))
                {
                    JArray linesElem = sheet.Property("lines").Value as JArray;
                    for (int j = 0; j < linesElem.Count; ++j)
                    {
                        Test val = new Test();
                        val.Load(linesElem[j] as JObject);
                        TestList.Add(val);
                    }
                }
                else if (sheetName.Equals("SecondSheet"))
                {
                    JArray linesElem = sheet.Property("lines").Value as JArray;
                    for (int j = 0; j < linesElem.Count; ++j)
                    {
                        SecondSheet val = new SecondSheet();
                        val.Load(linesElem[j] as JObject);
                        SecondSheetList.Add(val);
                    }
                }
            }
            for (int i = 0; i < TestList.Count; ++i)
            {
                TestList[i].ResolveReferences(this);
            }
            for (int i = 0; i < SecondSheetList.Count; ++i)
            {
                SecondSheetList[i].ResolveReferences(this);
            }
        }
コード例 #4
0
ファイル: TestCode.cs プロジェクト: JSandusky/CastleDBGen
 public void ResolveReferences(MyDB db)
 {
     for (int i = 0; i < db.SecondSheetList.Count; ++i) {
     if (db.SecondSheetList[i].ID.Equals(NewRefTestKey)) {
         NewRefTest = db.SecondSheetList[i];
         break;
     }
     }
 }