コード例 #1
0
        private void readJsonDataFilesObjectMap(JToken node, ReadingOptions options)
        {
            DataFilesObjectMap.Clear();
            if (!options.DataFilesObjectMap)
            {
                return;
            }
            JObject dataFilesObjectMapObject = node.Value <JObject>("dataFilesObjectMap");

            if (dataFilesObjectMapObject == null)
            {
                return;
            }

            foreach (KeyValuePair <string, JToken> entry in dataFilesObjectMapObject)
            {
                List <string[]> objectNameList = ((JArray)entry.Value).Values <JArray>()
                                                 .Select(namesArray => namesArray.Values <string>().ToArray())
                                                 .ToList();
                DataFilesObjectMap[int.Parse(entry.Key)] = objectNameList;
            }
        }
コード例 #2
0
        private void readBinaryDataFilesObjectMap(ArkArchive archive, ReadingOptions options)
        {
            DataFilesObjectMap.Clear();
            if (options.DataFilesObjectMap)
            {
                int dataFilesCount = archive.ReadInt();
                for (int n = 0; n < dataFilesCount; n++)
                {
                    int      level = archive.ReadInt();
                    int      count = archive.ReadInt();
                    string[] names = new string[count];
                    for (int index = 0; index < count; index++)
                    {
                        names[index] = archive.ReadString();
                    }

                    if (!DataFilesObjectMap.ContainsKey(level) || DataFilesObjectMap[level] == null)
                    {
                        DataFilesObjectMap.Add(level, new List <string[]> {
                            names
                        });
                    }
                }
            }
            else
            {
                archive.HasUnknownData = true;
                int count = archive.ReadInt();
                for (int entry = 0; entry < count; entry++)
                {
                    archive.SkipBytes(4);
                    int stringCount = archive.ReadInt();
                    for (int stringIndex = 0; stringIndex < stringCount; stringIndex++)
                    {
                        archive.SkipString();
                    }
                }
            }
        }