Class ParticleSnapshot
Namespace: ValveResourceFormat.Blocks
Assembly: ValveResourceFormat.dll
"SNAP" block.
public class ParticleSnapshot : BlockInheritance
object ← Block ← ParticleSnapshot
Inherited Members
Block.Type, Block.Offset, Block.Size, Block.Resource, Block.Read(BinaryReader), Block.ToString(), Block.WriteText(IndentedTextWriter), Block.Serialize(Stream)
Extension Methods
ResourceDataExtensions.AsKeyValueCollection(Block)
Properties
AttributeData
Gets the particle attribute data by name and type.
public IReadOnlyDictionary<(string Name, string Type), IEnumerable> AttributeData { get; }Property Value
IReadOnlyDictionary<(string Name, string Type), IEnumerable>
NumParticles
Gets the number of particles.
public uint NumParticles { get; }Property Value
Type
Gets the block type.
public override BlockType Type { get; }Property Value
Methods
Create(uint, IReadOnlyDictionary<(string Name, string Type), IEnumerable>)
Builds a snapshot in memory (not backed by a resource file), e.g. from a map entity's path nodes. The attribute arrays are looked up by name; float[] and Vector3[] are the supported element types.
public static ParticleSnapshot Create(uint numParticles, IReadOnlyDictionary<(string Name, string Type), IEnumerable> attributeData)Parameters
numParticles uint
attributeData IReadOnlyDictionary<(string Name, string Type), IEnumerable>
Returns
GetSnapshotAttributeName(ParticleField)
Maps a to the snapshot attribute name it is stored under in
, or null when the field has no snapshot representation.public static string? GetSnapshotAttributeName(ParticleField field)Parameters
field ParticleField
Returns
Read(BinaryReader)
Reads the block data from a binary reader.
public override void Read(BinaryReader reader)Parameters
reader BinaryReader
The binary reader to read from.
Serialize(Stream)
Writes the binary representation of the object to Stream.
public override void Serialize(Stream stream)Parameters
stream Stream
Stream.
WriteText(IndentedTextWriter)
Writes the correct text dump of the object to .
public override void WriteText(IndentedTextWriter writer)Parameters
writer IndentedTextWriter

