Ultimate Replay Scripting Reference
ReplayState Class |
A ReplayState allows replay objects to serialize and deserialize their data.
See IReplaySerialize.
Inheritance Hierarchy
Namespace: UltimateReplay
Assembly: UltimateReplay (in UltimateReplay.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
public sealed class ReplayState
The ReplayState type exposes the following members.
Constructors
Name | Description | |
---|---|---|
ReplayState |
Create an empty ReplayState that can be written to.
|
Methods
Name | Description | |
---|---|---|
Clear |
Clears all buffered data from this ReplayState and resets its state.
| |
Read16 |
Read a short from the state.
| |
Read32 |
Read an int from the state.
| |
ReadBool |
Read a bool from the state.
| |
ReadByte |
Read a byte from the state.
| |
ReadBytes(Int32) |
Read a byte array from the state.
| |
ReadBytes(Byte, Int32, Int32) |
Fill a byte array with data from the state.
| |
ReadColor |
Read a colour from the state.
| |
ReadColor32 |
Read a colour32 from the state.
| |
ReadFloat |
Read a float from the state.
| |
ReadFloatLowPrecision |
Attempts to read a low precision float.
You should only use this method when the value is relativley small (less than 65000).
| |
ReadIdentity |
Read a ReplayIdentity from the state.
| |
ReadQuat |
Read a quaternion from the state.
| |
ReadState |
Read the specified amount of bytes as a new ReplayState.
| |
ReadString |
Read a string from the state
| |
ReadVec2 |
Read a vector2 from the state.
| |
ReadVec3 |
Read a vector3 from the state.
| |
ReadVec4 |
Read a vector4 from the state.
| |
ToArray |
Get the ReplayState data as a byte array.
| |
TryReadObject |
Attempts to read an object state from this ReplayState.
| |
TryWriteObject |
Attempts to write an object to this ReplayState.
This method may write extra meta data for deserialization purposes which may cause excessive storage size.
Use one of the Write(Byte) methods if the type is known at compile time.
| |
Write(Boolean) |
Write a bool to the state.
| |
Write(Byte) |
Write a byte to the state.
| |
Write(Byte) |
Write a byte array to the state.
| |
Write(Int16) |
Write a short to the state.
| |
Write(Int32) |
Write an int to the state.
| |
Write(Single) |
Write a float to the state.
| |
Write(String) |
Write a string to the state.
| |
Write(Color) |
Write a colour to the state.
| |
Write(Color32) |
Write a colour32 value to the state.
| |
Write(Quaternion) |
Write a quaternion to the state.
| |
Write(Vector2) |
Write a vector2 to the state.
| |
Write(Vector3) |
Write a vector3 to the state.
| |
Write(Vector4) |
Write a vector4 to the state.
| |
Write(ReplayIdentity) |
Write the specified replay identity to this ReplayState.
| |
Write(ReplayState) |
Write the entire contents of a ReplayState to this ReplayState.
All bytes will be appended.
| |
Write(Byte, Int32, Int32) |
Write a byte array to the state using an offset position and length.
| |
WriteLowPrecision |
Attempts to write a 32 bit float value as a low precision 16 bit representation.
You should only use this method when the value is relativley small (less than 65000).
Accuracy may be lost by storing low precision values.
|
Properties
Name | Description | |
---|---|---|
CanRead |
Returns true if the state contains any more data.
| |
EndRead |
Returns true if the read pointer is at the end of the buffered data or false if there is still data to be read.
| |
Size |
Returns the size of the object state in bytes.
|
See Also