示例#1
0
 public ChaFile()
 {
     this.custom            = new ChaFileCustom();
     this.coordinate        = new ChaFileCoordinate();
     this.parameter         = new ChaFileParameter();
     this.gameinfo          = new ChaFileGameInfo();
     this.status            = new ChaFileStatus();
     this.lastLoadErrorCode = 0;
 }
示例#2
0
        public static bool CheckDataRangeCoordinate(
            ChaFileCoordinate coorde,
            int sex,
            List <string> checkInfo = null)
        {
            ChaListControl chaListCtrl = Singleton <Character> .Instance.chaListCtrl;
            bool           flag        = false;

            string[] strArray = new string[8]
            {
                "トップス",
                "ボトムス",
                "インナー上",
                "インナー下",
                "手袋",
                "パンスト",
                "靴下",
                "靴"
            };
            ChaListDefine.CategoryNo[] categoryNoArray = new ChaListDefine.CategoryNo[8]
            {
                sex != 0 ? ChaListDefine.CategoryNo.fo_top : ChaListDefine.CategoryNo.mo_top,
                sex != 0 ? ChaListDefine.CategoryNo.fo_bot : ChaListDefine.CategoryNo.mo_bot,
                sex != 0 ? ChaListDefine.CategoryNo.fo_inner_t : ChaListDefine.CategoryNo.unknown,
                sex != 0 ? ChaListDefine.CategoryNo.fo_inner_b : ChaListDefine.CategoryNo.unknown,
                sex != 0 ? ChaListDefine.CategoryNo.fo_gloves : ChaListDefine.CategoryNo.mo_gloves,
                sex != 0 ? ChaListDefine.CategoryNo.fo_panst : ChaListDefine.CategoryNo.unknown,
                sex != 0 ? ChaListDefine.CategoryNo.fo_socks : ChaListDefine.CategoryNo.unknown,
                sex != 0 ? ChaListDefine.CategoryNo.fo_shoes : ChaListDefine.CategoryNo.mo_shoes
            };
            int[] numArray1 = new int[8] {
                0, 1, 2, 3, 4, 5, 6, 7
            };
            int[] numArray2 = new int[8]
            {
                sex != 0 ? 0 : 0,
                sex != 0 ? 0 : 0,
                sex != 0 ? 0 : -1,
                sex != 0 ? 0 : -1,
                sex != 0 ? 0 : 0,
                sex != 0 ? 0 : -1,
                sex != 0 ? 0 : -1,
                sex != 0 ? 0 : 0
            };
            ChaFileClothes clothes = coorde.clothes;

            for (int index1 = 0; index1 < numArray1.Length; ++index1)
            {
                if (categoryNoArray[index1] != ChaListDefine.CategoryNo.unknown)
                {
                    if (!chaListCtrl.GetCategoryInfo(categoryNoArray[index1]).ContainsKey(clothes.parts[numArray1[index1]].id))
                    {
                        checkInfo?.Add(string.Format("【{0}】値:{1}", (object)strArray[index1], (object)clothes.parts[numArray1[index1]].id));
                        flag = true;
                        clothes.parts[numArray1[index1]].id = numArray2[index1];
                    }
                    Dictionary <int, ListInfoBase> categoryInfo = chaListCtrl.GetCategoryInfo(ChaListDefine.CategoryNo.st_pattern);
                    for (int index2 = 0; index2 < clothes.parts[numArray1[index1]].colorInfo.Length; ++index2)
                    {
                        if (!categoryInfo.ContainsKey(clothes.parts[numArray1[index1]].colorInfo[index2].pattern))
                        {
                            checkInfo?.Add(string.Format("【柄】値:{0}", (object)clothes.parts[numArray1[index1]].colorInfo[index2].pattern));
                            flag = true;
                            clothes.parts[numArray1[index1]].colorInfo[index2].pattern = 0;
                        }
                    }
                }
            }
            ChaFileAccessory accessory = coorde.accessory;

            for (int index = 0; index < accessory.parts.Length; ++index)
            {
                int type = accessory.parts[index].type;
                int id   = accessory.parts[index].id;
                Dictionary <int, ListInfoBase> categoryInfo = chaListCtrl.GetCategoryInfo((ChaListDefine.CategoryNo)type);
                if (categoryInfo != null && !categoryInfo.ContainsKey(accessory.parts[index].id))
                {
                    checkInfo?.Add(string.Format("【{0}】値:{1}", (object)ChaAccessoryDefine.GetAccessoryTypeName((ChaListDefine.CategoryNo)type), (object)accessory.parts[index].id));
                    flag = true;
                    accessory.parts[index].MemberInit();
                }
            }
            return(flag);
        }
示例#3
0
 public void CopyCoordinate(ChaFileCoordinate _coordinate)
 {
     this.SetCoordinateBytes(ChaFile.GetCoordinateBytes(_coordinate), ChaFileDefine.ChaFileCoordinateVersion);
 }
示例#4
0
 public static byte[] GetCoordinateBytes(ChaFileCoordinate _coordinate)
 {
     return(_coordinate.SaveBytes());
 }