本文整理汇总了C#中Blamite.Serialization.StructureValueCollection类的典型用法代码示例。如果您正苦于以下问题:C# StructureValueCollection类的具体用法?C# StructureValueCollection怎么用?C# StructureValueCollection使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
StructureValueCollection类属于Blamite.Serialization命名空间,在下文中一共展示了StructureValueCollection类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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;
}
示例2: StructureReader
private long _offset; // The offset that the reader is currently at
#endregion Fields
#region Constructors
/// <summary>
/// (private) Constructs a new StructureReader.
/// </summary>
/// <param name="reader">The IReader to read from.</param>
private StructureReader(IReader reader)
{
_reader = reader;
_baseOffset = reader.Position;
_offset = _baseOffset;
_collection = new StructureValueCollection();
}
示例3: Load
private void Load(StructureValueCollection values)
{
Magic = (int) values.GetInteger("magic");
ParentMagic = (int) values.GetInteger("parent magic");
GrandparentMagic = (int) values.GetInteger("grandparent magic");
Description = new StringID(values.GetIntegerOrDefault("stringid", 0));
}
示例4: Load
private void Load(StructureValueCollection values, IReader reader, FileSegmentGroup metaArea,
EngineDescription buildInfo)
{
Name = new StringID(values.GetInteger("name stringid"));
LoadPermutations(values, reader, metaArea, buildInfo);
}
示例5: 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;
}
示例6: Load
private void Load(StructureValueCollection values)
{
Magic = (int) values.GetInteger("magic");
ParentMagic = (int) values.GetInteger("parent magic");
GrandparentMagic = (int) values.GetInteger("grandparent magic");
// No description stringid :(
}
示例7: StructureWriter
private long _offset; // The offset that the writer is currently at
#endregion Fields
#region Constructors
private StructureWriter(StructureValueCollection values, IWriter writer)
{
_writer = writer;
_baseOffset = writer.Position;
_offset = _baseOffset;
_collection = values;
}
示例8: Load
private void Load(StructureValueCollection values, FileSegmenter segmenter)
{
_eofSegment = segmenter.WrapEOF((int) values.GetInteger("file size"));
var metaOffset = (int) values.GetInteger("meta offset");
var metaSize = (int) values.GetInteger("meta size");
uint metaOffsetMask = values.GetInteger("meta offset mask");
var metaSegment = new FileSegment(
segmenter.DefineSegment(metaOffset, metaSize, 0x200, SegmentResizeOrigin.Beginning), segmenter);
MetaArea = new FileSegmentGroup(new MetaOffsetConverter(metaSegment, metaOffsetMask));
IndexHeaderLocation = MetaArea.AddSegment(metaSegment);
Type = (CacheFileType) values.GetInteger("type");
var headerGroup = new FileSegmentGroup();
headerGroup.AddSegment(segmenter.WrapSegment(0, HeaderSize, 1, SegmentResizeOrigin.None));
StringIDCount = (int) values.GetInteger("string table count");
var sidDataSize = (int) values.GetInteger("string table size");
StringIDData = segmenter.WrapSegment((int) values.GetInteger("string table offset"), sidDataSize, 1,
SegmentResizeOrigin.End);
StringIDIndexTable = segmenter.WrapSegment((int) values.GetInteger("string index table offset"), StringIDCount*4, 4,
SegmentResizeOrigin.End);
FileNameCount = (int) values.GetInteger("file table count");
var fileDataSize = (int) values.GetInteger("file table size");
FileNameData = segmenter.WrapSegment((int) values.GetInteger("file table offset"), fileDataSize, 1,
SegmentResizeOrigin.End);
FileNameIndexTable = segmenter.WrapSegment((int) values.GetInteger("file index table offset"), FileNameCount*4, 4,
SegmentResizeOrigin.End);
InternalName = values.GetString("internal name");
ScenarioName = values.GetString("scenario name");
StringArea = new FileSegmentGroup();
StringArea.AddSegment(segmenter.WrapSegment((int) values.GetInteger("string block offset"), StringIDCount*0x80, 0x80,
SegmentResizeOrigin.End));
StringArea.AddSegment(StringIDIndexTable);
StringArea.AddSegment(StringIDData);
StringArea.AddSegment(FileNameIndexTable);
StringArea.AddSegment(FileNameData);
StringIDIndexTableLocation = SegmentPointer.FromOffset(StringIDIndexTable.Offset, StringArea);
StringIDDataLocation = SegmentPointer.FromOffset(StringIDData.Offset, StringArea);
FileNameIndexTableLocation = SegmentPointer.FromOffset(FileNameIndexTable.Offset, StringArea);
FileNameDataLocation = SegmentPointer.FromOffset(FileNameData.Offset, StringArea);
LocaleArea = new FileSegmentGroup();
var rawTableOffset = (int) values.GetInteger("raw table offset");
var rawTableSize = (int) values.GetInteger("raw table size");
RawTable = segmenter.WrapSegment(rawTableOffset, rawTableSize, 1, SegmentResizeOrigin.End);
Checksum = values.GetInteger("checksum");
// Set up a bogus partition table
Partitions = new Partition[1];
Partitions[0] = new Partition(SegmentPointer.FromOffset(MetaArea.Offset, MetaArea), (uint) MetaArea.Size);
}
示例9: SecondGenHeader
public SecondGenHeader(StructureValueCollection values, EngineDescription info, string buildString,
FileSegmenter segmenter)
{
BuildString = buildString;
HeaderSize = info.HeaderSize;
Load(values, segmenter);
}
示例10: WriteStructure
public static void WriteStructure(StructureValueCollection values, StructureLayout layout, IWriter writer)
{
var structWriter = new StructureWriter(values, writer);
layout.Accept(structWriter);
if (layout.Size > 0)
structWriter.SeekWriter(layout.Size);
}
示例11: FourthGenHeader
public FourthGenHeader(StructureValueCollection map_values, StructureValueCollection tag_values, StructureValueCollection string_values, EngineDescription info, string buildString,
FileSegmenter segmenter)
{
EngineInfo = info;
BuildString = buildString;
HeaderSize = info.HeaderSize;
Load(map_values, tag_values, string_values, segmenter);
}
示例12: Load
private void Load(StructureValueCollection values, StringID[] stringIds)
{
SoundName = stringIds[values.GetInteger("sound name index")];
ParametersIndex = (int)values.GetInteger("parameters index");
FirstRuntimePermutationFlagIndex = (int)values.GetInteger("first runtime permutation flag index");
EncodedPermutationCount = ((int)values.GetInteger("encoded permutation count") >> 4) & 63;
FirstPermutationIndex = (int)values.GetInteger("first permutation index");
}
示例13: Load
private void Load(StructureValueCollection values, IReader reader, FileSegmentGroup metaArea,
EngineDescription buildInfo)
{
ModelResourceIndex = new DatumIndex(values.GetInteger("model resource datum index"));
LoadSections(values, reader, metaArea, buildInfo);
LoadBoundingBoxes(values, reader, metaArea, buildInfo);
}
示例14: 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;
}
示例15: FourthGenLanguage
public FourthGenLanguage(GameLanguage language, StructureValueCollection values, FileSegmenter segmenter,
FileSegmentGroup localeArea, EngineDescription buildInfo)
{
Language = language;
_pointerLayout = buildInfo.Layouts.GetLayout("locale index table entry");
_encryptionKey = buildInfo.LocaleKey;
_sizeAlign = (_encryptionKey != null) ? AES.BlockSize : 1;
Load(values, segmenter, localeArea);
}