Esempio n. 1
0
        //セーブデータ用のバイナリ読み込み
        public void Read(BinaryReader reader, AdvParamData.FileType fileType)
        {
            int version = reader.ReadInt32();

            if (version < 0 || version > Version)
            {
                Debug.LogError(LanguageErrorMsg.LocalizeTextFormat(ErrorMsg.UnknownVersion, version));
                return;
            }

            int count = reader.ReadInt32();

            for (int i = 0; i < count; i++)
            {
                string key = reader.ReadString();
                if (Tbl.ContainsKey(key))
                {
                    reader.ReadBuffer((x) => Tbl[key].Read(x, fileType));
                }
                else
                {
                    //セーブされていたが、パラメーター設定から消えているので読み込まない
                    reader.SkipBuffer();
                }
            }
        }
Esempio n. 2
0
        //セーブデータ用のバイナリ読み込み
        public void Read(BinaryReader reader, AdvParamData.FileType fileType)
        {
            int version = reader.ReadInt32();

            if (version < 0 || version > Version)
            {
                Debug.LogError(LanguageErrorMsg.LocalizeTextFormat(ErrorMsg.UnknownVersion, version));
                return;
            }

            int count = reader.ReadInt32();

            for (int i = 0; i < count; i++)
            {
                string       key         = reader.ReadString();
                string       paramString = reader.ReadString();
                AdvParamData data;
                if (Tbl.TryGetValue(key, out data))
                {
                    if (data.SaveFileType == fileType)
                    {
                        data.Read(paramString);
                    }
                }
                else
                {
                    //セーブされていたが、パラメーター設定から消えているので読み込まない
                }
            }
        }
Esempio n. 3
0
        //セーブデータ用のバイナリ読み込み
        public void Read(BinaryReader reader, AdvParamData.FileType fileType)
        {
            //基本的なパラメーターをデフォルト値でリセット(システムデータ以外)
            if (fileType == AdvParamData.FileType.Default)
            {
                this.InitDefaultNormal(DefaultParameter);
            }

            int version = reader.ReadInt32();

            if (version < 0 || version > Version)
            {
                Debug.LogError(LanguageErrorMsg.LocalizeTextFormat(ErrorMsg.UnknownVersion, version));
                return;
            }

            int count = reader.ReadInt32();

            for (int i = 0; i < count; i++)
            {
                string key = reader.ReadString();
                if (StructTbl.ContainsKey(key))
                {
                    reader.ReadBuffer((x) => StructTbl[key].Read(x, fileType));
                }
                else
                {
                    //セーブされていたが、パラメーター設定から消えているので読み込まない
                    reader.SkipBuffer();
                }
            }
        }
Esempio n. 4
0
 internal void Write(BinaryWriter writer, AdvParamData.FileType fileType)
 {
     writer.Write(Version);
     writer.Write(Tbl.Count);
     foreach (var keyValue in Tbl)
     {
         writer.Write(keyValue.Key);
         BinaryUtil.WriteBytes(writer, BinaryUtil.BinaryWrite((x) => keyValue.Value.Write(x, fileType)));
     }
 }
Esempio n. 5
0
 //セーブデータ用のバイナリ書き込み
 public void Write(BinaryWriter writer, AdvParamData.FileType fileType)
 {
     Profiler.BeginSample(" Write StructTbl");
     writer.Write(Version);
     writer.Write(Tbl.Count);
     foreach (var keyValue in Tbl)
     {
         writer.Write(keyValue.Key);
         writer.WriteBuffer((x) => keyValue.Value.Write(x, fileType));
     }
     Profiler.EndSample();
 }
Esempio n. 6
0
        public List <AdvParamData> GetFileTypeList(AdvParamData.FileType fileType)
        {
            List <AdvParamData> list = new List <AdvParamData>();

            foreach (var keyValue in Tbl)
            {
                if (keyValue.Value.SaveFileType == fileType)
                {
                    list.Add(keyValue.Value);
                }
            }
            return(list);
        }
Esempio n. 7
0
        //システムファイルのセーブするデータ数をカウント
        public int CountFileType(AdvParamData.FileType fileType)
        {
            int count = 0;

            foreach (var keyValue in Tbl)
            {
                if (keyValue.Value.SaveFileType == fileType)
                {
                    ++count;
                }
            }
            return(count);
        }
        public List <AdvParamData> GetFileTypeList(AdvParamData.FileType fileType)
        {
            List <AdvParamData> list = new List <AdvParamData>();

            foreach (KeyValuePair <string, AdvParamData> pair in this.Tbl)
            {
                if (pair.Value.SaveFileType == fileType)
                {
                    list.Add(pair.Value);
                }
            }
            return(list);
        }
        public int CountFileType(AdvParamData.FileType fileType)
        {
            int num = 0;

            foreach (KeyValuePair <string, AdvParamData> pair in this.Tbl)
            {
                if (pair.Value.SaveFileType == fileType)
                {
                    num++;
                }
            }
            return(num);
        }
Esempio n. 10
0
        //バイナリ書き込み
        internal void Write(BinaryWriter writer, AdvParamData.FileType fileType)
        {
            int count = CountFileType(fileType);

            writer.Write(Version);
            writer.Write(count);
            foreach (var item in Tbl.Values)
            {
                if (item.SaveFileType == fileType)
                {
                    item.Write(writer);
                }
            }
        }
        public void Write(BinaryWriter writer, AdvParamData.FileType fileType)
        {
            int num = this.CountFileType(fileType);

            writer.Write(0);
            writer.Write(num);
            foreach (KeyValuePair <string, AdvParamData> pair in this.Tbl)
            {
                if (pair.Value.SaveFileType == fileType)
                {
                    writer.Write(pair.Value.Key);
                    writer.Write(pair.Value.ParameterString);
                }
            }
        }
Esempio n. 12
0
        //セーブデータ用のバイナリ書き込み
        public void Write(BinaryWriter writer, AdvParamData.FileType fileType)
        {
//			Profiler.BeginSample("Write Param");
            int count = CountFileType(fileType);

            writer.Write(Version);
            writer.Write(count);

            foreach (var keyValue in Tbl)
            {
                if (keyValue.Value.SaveFileType == fileType)
                {
                    writer.Write(keyValue.Value.Key);
                    writer.Write(keyValue.Value.ParameterString);
                }
            }
//			Profiler.EndSample();
        }
        public void Read(BinaryReader reader, AdvParamData.FileType fileType)
        {
            int num = reader.ReadInt32();

            if ((num < 0) || (num > 0))
            {
                object[] args = new object[] { num };
                Debug.LogError(LanguageErrorMsg.LocalizeTextFormat(ErrorMsg.UnknownVersion, args));
            }
            else
            {
                int num2 = reader.ReadInt32();
                for (int i = 0; i < num2; i++)
                {
                    AdvParamData data;
                    string       key         = reader.ReadString();
                    string       paramString = reader.ReadString();
                    if (this.Tbl.TryGetValue(key, out data) && (data.SaveFileType == fileType))
                    {
                        data.Read(paramString);
                    }
                }
            }
        }
Esempio n. 14
0
 public void Read(BinaryReader reader, AdvParamData.FileType fileType)
 {
Esempio n. 15
0
 public IoInerface(AdvParamManager param, AdvParamData.FileType fileType)
 {
     Param    = param;
     FileType = fileType;
 }