本文整理汇总了C#中Blamite.Serialization.StructureValueCollection.SetInteger方法的典型用法代码示例。如果您正苦于以下问题:C# StructureValueCollection.SetInteger方法的具体用法?C# StructureValueCollection.SetInteger怎么用?C# StructureValueCollection.SetInteger使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Blamite.Serialization.StructureValueCollection
的用法示例。
在下文中一共展示了StructureValueCollection.SetInteger方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Serialize
/// <summary>
/// Serializes this instance.
/// </summary>
/// <returns>A collection of structure values.</returns>
public StructureValueCollection Serialize()
{
var result = new StructureValueCollection();
result.SetInteger("virtual address", VirtualAddress);
result.SetInteger("size", Size);
return result;
}
示例2: Serialize
/// <summary>
/// Serializes this instance.
/// </summary>
/// <returns>The serialized structure values.</returns>
public StructureValueCollection Serialize()
{
var values = new StructureValueCollection();
values.SetInteger("range start index", (uint) StartIndex);
values.SetInteger("range size", (uint) Size);
return values;
}
示例3: Serialize
public StructureValueCollection Serialize(IList<ITagClass> classList)
{
var result = new StructureValueCollection();
result.SetInteger("memory address", (MetaLocation != null) ? MetaLocation.AsPointer() : 0);
result.SetInteger("class index", (Class != null) ? (uint) classList.IndexOf(Class) : 0xFFFFFFFF);
result.SetInteger("datum index salt", Index.Salt);
return result;
}
示例4: Serialize
public StructureValueCollection Serialize()
{
var result = new StructureValueCollection();
result.SetInteger("string count", (uint) StringCount);
result.SetInteger("locale table size", LocaleData != null ? (uint) LocaleData.Size : 0);
if (LocaleIndexTableLocation != null)
result.SetInteger("locale index table offset", LocaleIndexTableLocation.AsPointer());
if (LocaleDataLocation != null)
result.SetInteger("locale data index offset", LocaleDataLocation.AsPointer());
if (IndexTableHash != null)
result.SetRaw("index table hash", IndexTableHash);
if (StringDataHash != null)
result.SetRaw("string data hash", StringDataHash);
return result;
}
示例5: Serialize
/// <summary>
/// Serializes this instance.
/// </summary>
/// <returns>A writable set of structure values.</returns>
public StructureValueCollection Serialize()
{
var result = new StructureValueCollection();
result.SetFloat("min x", MinX);
result.SetFloat("max x", MaxX);
result.SetFloat("min y", MinY);
result.SetFloat("max y", MaxY);
result.SetFloat("min z", MinZ);
result.SetFloat("max z", MaxZ);
result.SetFloat("min u", MinU);
result.SetFloat("max u", MaxU);
result.SetFloat("min v", MinV);
result.SetFloat("max v", MaxV);
result.SetInteger("unknown 1", (uint) Unknown1);
result.SetInteger("unknown 2", (uint) Unknown2);
result.SetInteger("unknown 3", (uint) Unknown3);
result.SetInteger("unknown 4", (uint) Unknown4);
return result;
}
示例6: SerializePointer
private StructureValueCollection SerializePointer(ResourcePointer pointer)
{
var result = new StructureValueCollection();
result.SetInteger("primary page index", (pointer.PrimaryPage != null) ? (uint) pointer.PrimaryPage.Index : 0xFFFFFFFF);
result.SetInteger("primary offset", (uint) pointer.PrimaryOffset);
result.SetInteger("primary unknown", (uint) pointer.PrimaryUnknown);
result.SetInteger("secondary page index",
(pointer.SecondaryPage != null) ? (uint) pointer.SecondaryPage.Index : 0xFFFFFFFF);
result.SetInteger("secondary offset", (uint) pointer.SecondaryOffset);
result.SetInteger("secondary unknown", (uint) pointer.SecondaryUnknown);
return result;
}
示例7: SerializePage
private StructureValueCollection SerializePage(ResourcePage page, FourthGenCacheFileReference[] externalFiles)
{
var result = new StructureValueCollection();
result.SetInteger("salt", page.Salt);
result.SetInteger("flags", page.Flags);
result.SetInteger("compression codec index",
(page.CompressionMethod != ResourcePageCompression.None) ? 0 : 0xFFFFFFFF);
result.SetInteger("shared cache file index",
(page.FilePath != null) ? (uint) FindExternalFile(externalFiles, page.FilePath) : 0xFFFFFFFF);
result.SetInteger("unknown 1", (uint) page.Unknown1);
result.SetInteger("compressed block offset", (uint) page.Offset);
result.SetInteger("compressed block size", (uint) page.CompressedSize);
result.SetInteger("uncompressed block size", (uint) page.UncompressedSize);
result.SetInteger("checksum", page.Checksum);
result.SetRaw("hash 1", page.Hash1);
result.SetRaw("hash 2", page.Hash2);
result.SetRaw("hash 3", page.Hash3);
result.SetInteger("unknown 2", (uint) page.Unknown2);
result.SetInteger("unknown 3", (uint) page.Unknown3);
return result;
}
示例8: Serialize
public StructureValueCollection Serialize()
{
var result = new StructureValueCollection();
result.SetInteger("file size", FileSize);
result.SetInteger("meta offset", (uint) MetaArea.Offset);
result.SetInteger("meta size", (uint) MetaArea.Size);
result.SetInteger("meta offset mask", MetaArea.BasePointer);
result.SetInteger("type", (uint) Type);
result.SetInteger("string table count", (uint) StringIDCount);
result.SetInteger("string table size", (uint) StringIDData.Size);
result.SetInteger("string index table offset", (uint) StringIDIndexTable.Offset);
result.SetInteger("string table offset", (uint) StringIDData.Offset);
result.SetString("internal name", InternalName);
result.SetString("scenario name", ScenarioName);
result.SetInteger("file table count", (uint) FileNameCount);
result.SetInteger("file table offset", (uint) FileNameData.Offset);
result.SetInteger("file table size", (uint) FileNameData.Size);
result.SetInteger("file index table offset", (uint) FileNameIndexTable.Offset);
result.SetInteger("raw table offset", (uint) RawTable.Offset);
result.SetInteger("raw table size", (uint) RawTable.Size);
result.SetInteger("checksum", Checksum);
return result;
}
示例9: SaveTags
private void SaveTags(StructureValueCollection headerValues, IStream stream)
{
var oldCount = (int) headerValues.GetInteger("number of tags");
uint oldAddress = headerValues.GetInteger("tag table address");
StructureLayout layout = _buildInfo.Layouts.GetLayout("tag entry");
IEnumerable<StructureValueCollection> entries = _tags.Select(t => ((ThirdGenTag) t).Serialize(Classes));
// hax, _tags is a list of ITag objects so we have to upcast
uint newAddress = ReflexiveWriter.WriteReflexive(entries, oldCount, oldAddress, _tags.Count, layout, _metaArea,
_allocator, stream);
headerValues.SetInteger("number of tags", (uint) _tags.Count);
headerValues.SetInteger("tag table address", newAddress);
}
示例10: Serialize
/// <summary>
/// Serializes the header's values, storing them into a StructureValueCollection.
/// </summary>
/// <param name="localeArea">The locale area of the cache file. Can be null.</param>
/// <param name="localePointerMask">The value to add to locale pointers to translate them to file offsets.</param>
/// <returns>The resulting StructureValueCollection.</returns>
public StructureValueCollection Serialize(FileSegmentGroup localeArea)
{
var values = new StructureValueCollection();
values.SetInteger("file size", FileSize);
values.SetInteger("type", (uint) Type);
values.SetString("internal name", InternalName);
values.SetString("scenario name", ScenarioName);
values.SetInteger("xdk version", (uint) XDKVersion);
AdjustPartitions();
values.SetArray("partitions", SerializePartitions());
RebuildInteropData(localeArea);
values.SetArray("offset masks", SectionOffsetMasks.Select(m =>
{
var result = new StructureValueCollection();
result.SetInteger("mask", m);
return result;
}).ToArray());
values.SetArray("sections", Sections.Select(s => s.Serialize()).ToArray());
values.SetInteger("tag buffer offset", Sections[(int) ThirdGenInteropSectionType.Tag].VirtualAddress);
if (MetaArea != null)
{
values.SetInteger("virtual base address", MetaArea.BasePointer);
values.SetInteger("index header address", IndexHeaderLocation.AsPointer());
values.SetInteger("virtual size", (uint) MetaArea.Size);
}
if (StringBlockLocation != null)
values.SetInteger("string block offset", StringBlockLocation.AsPointer());
values.SetInteger("string table count", (uint) StringIDCount);
if (StringIDData != null)
{
values.SetInteger("string table size", (uint) StringIDData.Size);
values.SetInteger("string table offset", StringIDDataLocation.AsPointer());
}
if (StringIDIndexTableLocation != null)
values.SetInteger("string index table offset", StringIDIndexTableLocation.AsPointer());
if (StringArea != null)
values.SetInteger("string data size", (uint) StringArea.Size);
values.SetInteger("file table count", (uint) FileNameCount);
if (FileNameData != null)
{
values.SetInteger("file table offset", FileNameDataLocation.AsPointer());
values.SetInteger("file table size", (uint) FileNameData.Size);
}
if (FileNameIndexTableLocation != null)
values.SetInteger("file index table offset", FileNameIndexTableLocation.AsPointer());
if (localeArea != null)
{
values.SetInteger("locale data index offset", localeArea.BasePointer);
values.SetInteger("locale data size", (uint) localeArea.Size);
}
if (UnknownTableLocation != null)
{
values.SetInteger("unknown table count", (uint) UnknownCount);
values.SetInteger("unknown table offset", UnknownTableLocation.AsPointer());
}
return values;
}
示例11: VisitTagRef
public void VisitTagRef(TagRefData field)
{
SeekToOffset(field.Offset);
if (field.WithClass)
{
var values = new StructureValueCollection();
if (field.Value != null)
{
//hax
if (field.Value.RawTag == null)
{
values.SetInteger("class magic", (uint)field.Class.RawClass.Magic);
values.SetInteger("datum index", 0xFFFFFFFF);
}
else
{
values.SetInteger("class magic", (uint)field.Value.RawTag.Class.Magic);
values.SetInteger("datum index", field.Value.RawTag.Index.Value);
}
}
else
{
values.SetInteger("class magic", 0xFFFFFFFF);
values.SetInteger("datum index", 0xFFFFFFFF);
}
StructureWriter.WriteStructure(values, _tagRefLayout, _writer);
}
else
{
_writer.WriteUInt32(field.Value == null ? 0xFFFFFFFF : field.Value.RawTag.Index.Value);
}
}
示例12: SerializeDefinitionFixup
private StructureValueCollection SerializeDefinitionFixup(ResourceDefinitionFixup fixup)
{
var result = new StructureValueCollection();
result.SetInteger("offset", (uint) fixup.Offset);
result.SetInteger("type index", (uint) fixup.Type);
return result;
}
示例13: SerializeResourceFixup
private StructureValueCollection SerializeResourceFixup(ResourceFixup fixup)
{
var result = new StructureValueCollection();
result.SetInteger("offset", (uint) fixup.Offset);
result.SetInteger("address", fixup.Address);
return result;
}
示例14: SerializeResource
private StructureValueCollection SerializeResource(Resource resource, int pointerIndex, int infoOffset, IStream stream)
{
var result = new StructureValueCollection();
if (resource.ParentTag != null)
{
result.SetInteger("parent tag class magic", (uint) resource.ParentTag.Class.Magic);
result.SetInteger("parent tag datum index", resource.ParentTag.Index.Value);
}
else
{
result.SetInteger("parent tag class magic", 0xFFFFFFFF);
result.SetInteger("parent tag datum index", 0xFFFFFFFF);
}
result.SetInteger("datum index salt", resource.Index.Salt);
result.SetInteger("resource type index", (uint) FindResourceType(resource.Type));
result.SetInteger("flags", resource.Flags);
result.SetInteger("resource info offset", (uint) infoOffset);
result.SetInteger("resource info size", (resource.Info != null) ? (uint) resource.Info.Length : 0);
result.SetInteger("unknown 1", (uint) resource.Unknown1);
result.SetInteger("unknown 2", (uint) resource.Unknown2);
result.SetInteger("segment index", (uint) pointerIndex);
result.SetInteger("unknown 3", (uint) resource.Unknown3);
return result;
}
示例15: SaveResourceInfoBuffer
private void SaveResourceInfoBuffer(byte[] buffer, StructureValueCollection values, IStream stream)
{
// Free the old info buffer
var oldSize = (int) values.GetInteger("resource info buffer size");
uint oldAddress = values.GetInteger("resource info buffer address");
if (oldAddress >= 0 && oldSize > 0)
_allocator.Free(oldAddress, oldSize);
// Write a new one
uint newAddress = 0;
if (buffer.Length > 0)
{
newAddress = _allocator.Allocate(buffer.Length, 0x10, stream);
stream.SeekTo(_metaArea.PointerToOffset(newAddress));
stream.WriteBlock(buffer);
}
// Update values
values.SetInteger("resource info buffer size", (uint) buffer.Length);
values.SetInteger("resource info buffer address", newAddress);
}