当前位置: 首页>>代码示例>>C#>>正文


C# StructureValueCollection.HasInteger方法代码示例

本文整理汇总了C#中Blamite.Serialization.StructureValueCollection.HasInteger方法的典型用法代码示例。如果您正苦于以下问题:C# StructureValueCollection.HasInteger方法的具体用法?C# StructureValueCollection.HasInteger怎么用?C# StructureValueCollection.HasInteger使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Blamite.Serialization.StructureValueCollection的用法示例。


在下文中一共展示了StructureValueCollection.HasInteger方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GetObjectName

		private string GetObjectName(StructureValueCollection values, StringIDSource stringIDs)
		{
			if (values.HasString("name"))
			{
				return values.GetString("name");
			}
			if (values.HasInteger("name stringid"))
			{
				var sid = new StringID(values.GetInteger("name stringid"));
				return stringIDs.GetString(sid);
			}
			throw new InvalidOperationException("Unable to determine the name of objects in the \"" + _layoutName + "\" layout");
		}
开发者ID:t3hm00kz,项目名称:Assembly,代码行数:13,代码来源:ScriptObjectReflexive.cs

示例2: Load

        private void Load(StructureValueCollection values, IReader reader, FileSegmentGroup metaArea, StringIDSource stringIDs,
			EngineDescription buildInfo)
        {
            Name = values.HasInteger("name index")
                ? stringIDs.GetString(new StringID(values.GetInteger("name index")))
                : values.GetString("name");
            ExecutionType = (short) values.GetInteger("execution type");
            ReturnType = (short) values.GetInteger("return type");
            RootExpressionIndex = new DatumIndex(values.GetInteger("first expression index"));
            if (Name == null)
                Name = "script_" + RootExpressionIndex.Value.ToString("X8");

            Parameters = LoadParameters(reader, values, metaArea, buildInfo);
        }
开发者ID:no1dead,项目名称:Assembly,代码行数:14,代码来源:Script.cs

示例3: FreeBitArray

		private static void FreeBitArray(StructureValueCollection values, string countName, string addressName, MetaAllocator allocator)
		{
			if (!values.HasInteger(countName) || !values.HasInteger(addressName))
				return;

			var oldCount = (int)values.GetInteger(countName);
			uint oldAddress = values.GetInteger(addressName);
			if (oldCount > 0 && oldAddress > 0)
				allocator.Free(oldAddress, oldCount*4);
		}
开发者ID:t3hm00kz,项目名称:Assembly,代码行数:10,代码来源:ThirdGenZoneSet.cs

示例4: LoadBitArray

		private BitArray LoadBitArray(StructureValueCollection values, string countName, string addressName, IReader reader)
		{
			if (!values.HasInteger(countName) || !values.HasInteger(addressName))
				return new BitArray(0);

			var count = (int) values.GetInteger(countName);
			uint address = values.GetInteger(addressName);
			if (count <= 0 || address == 0)
				return new BitArray(0);

			var ints = new int[count];
			reader.SeekTo(_metaArea.PointerToOffset(address));
			for (int i = 0; i < count; i++)
				ints[i] = reader.ReadInt32();

			return new BitArray(ints);
		}
开发者ID:t3hm00kz,项目名称:Assembly,代码行数:17,代码来源:ThirdGenZoneSet.cs

示例5: ReadZoneSetTable

		private IEnumerable<FourthGenZoneSet> ReadZoneSetTable(StructureValueCollection tagValues, string countName, string addressName, IReader reader)
		{
			if (!tagValues.HasInteger(countName) || !tagValues.HasInteger(addressName))
				return Enumerable.Empty<FourthGenZoneSet>();

			var count = (int) tagValues.GetInteger(countName);
			uint address = tagValues.GetInteger(addressName);
			StructureLayout layout = _buildInfo.Layouts.GetLayout("zone set definition");
			StructureValueCollection[] entries = ReflexiveReader.ReadReflexive(reader, count, address, layout, _metaArea);
			return entries.Select(e => new FourthGenZoneSet(e, reader, _metaArea));
		}
开发者ID:t3hm00kz,项目名称:Assembly,代码行数:11,代码来源:FourthGenZoneSetTable.cs

示例6: FreeZoneSetsInTable

		private void FreeZoneSetsInTable(StructureValueCollection tagValues, string countName, string addressName, IReader reader)
		{
			if (!tagValues.HasInteger(countName) || !tagValues.HasInteger(addressName))
				return;

			var count = (int) tagValues.GetInteger(countName);
			uint address = tagValues.GetInteger(addressName);
			StructureLayout layout = _buildInfo.Layouts.GetLayout("zone set definition");
			StructureValueCollection[] entries = ReflexiveReader.ReadReflexive(reader, count, address, layout, _metaArea);
			foreach (StructureValueCollection entry in entries)
				FourthGenZoneSet.Free(entry, _allocator);
		}
开发者ID:t3hm00kz,项目名称:Assembly,代码行数:12,代码来源:FourthGenZoneSetTable.cs

示例7: SaveZoneSetTable

		private void SaveZoneSetTable(IZoneSet[] sets, StructureValueCollection tagValues, string countName, string addressName, ReflexiveCache<int> cache, IStream stream)
		{
			if (!tagValues.HasInteger(countName) || !tagValues.HasInteger(addressName))
				return;

			var count = (int) tagValues.GetInteger(countName);
			if (count != sets.Length)
				throw new InvalidOperationException("Zone set count does not match");

			uint address = tagValues.GetInteger(addressName);
			StructureLayout layout = _buildInfo.Layouts.GetLayout("zone set definition");
			List<StructureValueCollection> entries =
				sets.Select(set => ((FourthGenZoneSet) set).Serialize(stream, _allocator, cache)).ToList();
			ReflexiveWriter.WriteReflexive(entries, address, layout, _metaArea, stream);
		}
开发者ID:t3hm00kz,项目名称:Assembly,代码行数:15,代码来源:FourthGenZoneSetTable.cs

示例8: LoadResourceTypes

		private void LoadResourceTypes(StructureValueCollection values, IReader reader, StringIDSource stringIDs)
		{
			if (!values.HasInteger("number of resource types") || !values.HasInteger("resource type table address"))
				return;

			var count = (int) values.GetInteger("number of resource types");
			uint address = values.GetInteger("resource type table address");
			StructureLayout layout = _buildInfo.Layouts.GetLayout("resource type entry");
			StructureValueCollection[] entries = ReflexiveReader.ReadReflexive(reader, count, address, layout, _metaArea);
			_resourceTypes = entries.Select(e => new ThirdGenResourceType(e, stringIDs)).ToArray();
		}
开发者ID:t3hm00kz,项目名称:Assembly,代码行数:11,代码来源:ThirdGenResourceGestalt.cs

示例9: CalculateStringGroup

        private void CalculateStringGroup(StructureValueCollection values, FileSegmenter segmenter)
        {
            if (DebugPointerConverter == null)
                return;

            StringArea = new FileSegmentGroup(DebugPointerConverter);

            // StringIDs
            StringIDCount = (int) values.GetInteger("string table count");
            if (StringIDCount > 0)
            {
                int sidIndexTableOff = DebugPointerConverter.PointerToOffset(values.GetInteger("string index table offset"));
                int sidDataOff = DebugPointerConverter.PointerToOffset(values.GetInteger("string table offset"));

                var sidTableSize = (int) values.GetInteger("string table size");
                StringIDIndexTable = segmenter.WrapSegment(sidIndexTableOff, StringIDCount*4, 4, SegmentResizeOrigin.End);
                StringIDData = segmenter.WrapSegment(sidDataOff, sidTableSize, 1, SegmentResizeOrigin.End);

                StringIDIndexTableLocation = StringArea.AddSegment(StringIDIndexTable);
                StringIDDataLocation = StringArea.AddSegment(StringIDData);

                // idk what this is, but H3Beta has it
                if (values.HasInteger("string block offset"))
                {
                    int sidBlockOff = DebugPointerConverter.PointerToOffset(values.GetInteger("string block offset"));
                    StringBlock = segmenter.WrapSegment(sidBlockOff, StringIDCount*0x80, 0x80, SegmentResizeOrigin.End);
                    StringBlockLocation = StringArea.AddSegment(StringBlock);
                }
            }

            // Tag names
            FileNameCount = (int) values.GetInteger("file table count");
            if (FileNameCount > 0)
            {
                int nameIndexTableOff = DebugPointerConverter.PointerToOffset(values.GetInteger("file index table offset"));
                int nameDataOff = DebugPointerConverter.PointerToOffset(values.GetInteger("file table offset"));

                var fileTableSize = (int) values.GetInteger("file table size");
                FileNameIndexTable = segmenter.WrapSegment(nameIndexTableOff, FileNameCount*4, 4, SegmentResizeOrigin.End);
                FileNameData = segmenter.WrapSegment(nameDataOff, fileTableSize, 1, SegmentResizeOrigin.End);

                FileNameIndexTableLocation = StringArea.AddSegment(FileNameIndexTable);
                FileNameDataLocation = StringArea.AddSegment(FileNameData);
            }

            // Some H4-only unknown table
            if (values.HasInteger("unknown table count") && values.HasInteger("unknown table offset"))
            {
                UnknownCount = (int) values.GetInteger("unknown table count");
                if (UnknownCount > 0)
                {
                    int unknownOff = DebugPointerConverter.PointerToOffset(values.GetInteger("unknown table offset"));
                    UnknownTable = segmenter.WrapSegment(unknownOff, UnknownCount*0x10, 0x10, SegmentResizeOrigin.End);
                    UnknownTableLocation = StringArea.AddSegment(UnknownTable);
                }
            }
        }
开发者ID:Nibre,项目名称:Assembly,代码行数:57,代码来源:ThirdGenHeader.cs


注:本文中的Blamite.Serialization.StructureValueCollection.HasInteger方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。