Files
Javier Guardia FernándezandGitHub 0cbff8dee1 Change serialization reading to only do type checks once per type (#2018)
* Change serialization reading to only do type checks once per type

* Optimize for sealed types in arrays

* Oops the context

* Fix ISelfSerialize node type and null values

* Add int read test

* Remove nullability from constructor and property of DeserializedValue

* Add clearing readers to serialization shutdown

* Fix struct populate default values
Remove some notnull constraints

* Replace robust gen with normal il generator
2021-09-13 18:14:52 +02:00

25 lines
715 B
C#

namespace Robust.Shared.Serialization.Manager.Result
{
public abstract class DeserializationResult
{
public abstract object? RawValue { get; }
public abstract DeserializationResult PushInheritanceFrom(DeserializationResult source);
public abstract DeserializationResult Copy();
public abstract void CallAfterDeserializationHook();
public T Cast<T>() where T : DeserializationResult
{
if (this is T value) return value;
throw new InvalidDeserializedResultTypeException<T>(GetType());
}
}
public abstract class DeserializationResult<T> : DeserializationResult
{
public abstract T? Value { get; }
}
}