Class SerializationTimestamp
This struct should be used for auto-generated serialization timestamps which then may be used to check if serialized version is up to date.
When loaded it always contains last timestamp when it was serialized which may be used to ensure serialized versions contains actual copy and invalidate it if required (i.e. for height caches).
Can be just added to serialized class which aware about serialization timestamp.
IMPORTANT: It should be non-readonly field! If copied (i.e. when assigned by value) then it will contain snapshot value for LastSerializedValue.
Inheritance
System.Object
SerializationTimestamp
Assembly: Eco.Core.dll
Syntax
public sealed class SerializationTimestamp : ValueType
Constructors
SerializationTimestamp(Double)
Declaration
public SerializationTimestamp(double lastSerializedValue)
Parameters
Type |
Name |
Description |
System.Double |
lastSerializedValue |
|
Properties
LastSerializedValue
Contains last serialized Eco.Core.Serialization.SerializationTimestamp.Value (actually timestamp when it was last time serialized and persisted). The value is comparable with Seconds.
Declaration
public double LastSerializedValue { get; }
Property Value
Type |
Description |
System.Double |
|
Operators
Implicit(SerializationTimestamp to Double)
Declaration
public static implicit operator double (SerializationTimestamp timestamp)
Parameters
Returns
Type |
Description |
System.Double |
|
Extension Methods