Example #1
0
        internal static BuildLists Parse(BinaryReader reader, MapParseContext context, bool mapHasAssetList)
        {
            return(ParseAsset(reader, context, version =>
            {
                var numBuildLists = reader.ReadUInt32();
                var buildLists = new BuildList[numBuildLists];

                for (var i = 0; i < numBuildLists; i++)
                {
                    buildLists[i] = BuildList.Parse(reader, context, version, mapHasAssetList);
                }

                return new BuildLists
                {
                    Items = buildLists
                };
            }));
        }
Example #2
0
        internal static BuildList Parse(BinaryReader reader, MapParseContext context, ushort version)
        {
            var result = new BuildList();

            if (version >= 1)
            {
                result.FactionName = reader.ReadUInt16PrefixedAsciiString();
            }
            else
            {
                result.FactionNameProperty = AssetPropertyKey.Parse(reader, context);
            }

            var numBuildListItems = reader.ReadUInt32();

            result.Items = new BuildListItem2[numBuildListItems];

            for (var i = 0; i < numBuildListItems; i++)
            {
                result.Items[i] = BuildListItem2.Parse(reader, version);
            }

            return(result);
        }