using System; using System.Collections.Generic; using System.IO; using UnityEngine; namespace NeoSaveGames.Serialization { public interface INeoDeserializer { bool ReadFromStream(Stream stream); void BeginDeserialization(); void EndDeserialization(); bool isDeserializing { get; } bool PushContext(SerializationContext context, int id); void PopContext(SerializationContext context, int id);// Use type for error checking bool TryReadValue(string key, out bool output, bool defaultValue); bool TryReadValue(string key, out byte output, byte defaultValue); bool TryReadValue(string key, out sbyte output, sbyte defaultValue); bool TryReadValue(string key, out char output, char defaultValue); bool TryReadValue(string key, out short output, short defaultValue); bool TryReadValue(string key, out ushort output, ushort defaultValue); bool TryReadValue(string key, out int output, int defaultValue); bool TryReadValue(string key, out uint output, uint defaultValue); bool TryReadValue(string key, out long output, long defaultValue); bool TryReadValue(string key, out ulong output, ulong defaultValue); bool TryReadValue(string key, out float output, float defaultValue); bool TryReadValue(string key, out double output, double defaultValue); bool TryReadValue(string key, out Vector2 output, Vector2 defaultValue); bool TryReadValue(string key, out Vector3 output, Vector3 defaultValue); bool TryReadValue(string key, out Vector4 output, Vector4 defaultValue); bool TryReadValue(string key, out Vector2Int output, Vector2Int defaultValue); bool TryReadValue(string key, out Vector3Int output, Vector3Int defaultValue); bool TryReadValue(string key, out Quaternion output, Quaternion defaultValue); bool TryReadValue(string key, out Color output, Color defaultValue); bool TryReadValue(string key, out Color32 output, Color32 defaultValue); bool TryReadValue(string key, out Guid output); bool TryReadValue(string key, out DateTime output, DateTime defaultValue); bool TryReadValue(string key, out string output, string defaultValue); bool TryReadValues(string key, out bool[] output, bool[] defaultValues); bool TryReadValues(string key, out byte[] output, byte[] defaultValues); bool TryReadValues(string key, out sbyte[] output, sbyte[] defaultValues); bool TryReadValues(string key, out char[] output, char[] defaultValues); bool TryReadValues(string key, out short[] output, short[] defaultValues); bool TryReadValues(string key, out ushort[] output, ushort[] defaultValues); bool TryReadValues(string key, out int[] output, int[] defaultValues); bool TryReadValues(string key, out uint[] output, uint[] defaultValues); bool TryReadValues(string key, out long[] output, long[] defaultValues); bool TryReadValues(string key, out ulong[] output, ulong[] defaultValues); bool TryReadValues(string key, out float[] output, float[] defaultValues); bool TryReadValues(string key, out double[] output, double[] defaultValues); bool TryReadValues(string key, out string[] output, string[] defaultValues); bool TryReadValues(string key, out Vector2[] output, Vector2[] defaultValues); bool TryReadValues(string key, out Vector3[] output, Vector3[] defaultValues); bool TryReadValues(string key, out Vector4[] output, Vector4[] defaultValues); bool TryReadValues(string key, out Vector2Int[] output, Vector2Int[] defaultValues); bool TryReadValues(string key, out Vector3Int[] output, Vector3Int[] defaultValues); bool TryReadValues(string key, out Quaternion[] output, Quaternion[] defaultValues); bool TryReadValues(string key, out Color[] output, Color[] defaultValues); bool TryReadValues(string key, out Color32[] output, Color32[] defaultValues); bool TryReadValues(string key, out Guid[] output); bool TryReadValues(string key, List output); bool TryReadValues(string key, List output); bool TryReadValues(string key, List output); bool TryReadValues(string key, List output); bool TryReadValues(string key, List output); bool TryReadValues(string key, List output); bool TryReadValues(string key, List output); bool TryReadValues(string key, List output); bool TryReadValues(string key, List output); bool TryReadValues(string key, List output); bool TryReadValues(string key, List output); bool TryReadValues(string key, List output); bool TryReadValues(string key, List output); bool TryReadValues(string key, List output); bool TryReadValues(string key, List output); bool TryReadValues(string key, List output); bool TryReadValues(string key, List output); bool TryReadValues(string key, List output); bool TryReadValues(string key, List output); bool TryReadValues(string key, List output); bool TryReadValues(string key, List output); bool TryReadValues(string key, List output); bool TryReadSerializable(string key, out T output, T defaultValue); bool TryReadSerializables(string key, out T[] output, T[] defaultValues); bool TryReadSerializables(string key, List output); bool TryReadComponentReference(string key, out T output, NeoSerializedGameObject pathFrom) where T : class; bool TryReadTransformReference(string key, out Transform output, NeoSerializedGameObject pathFrom); bool TryReadGameObjectReference(string key, out GameObject output, NeoSerializedGameObject pathFrom); bool TryReadNeoSerializedGameObjectReference(string key, out NeoSerializedGameObject output, NeoSerializedGameObject pathFrom); bool TryReadValue(int hash, out bool output, bool defaultValue); bool TryReadValue(int hash, out byte output, byte defaultValue); bool TryReadValue(int hash, out sbyte output, sbyte defaultValue); bool TryReadValue(int hash, out char output, char defaultValue); bool TryReadValue(int hash, out short output, short defaultValue); bool TryReadValue(int hash, out ushort output, ushort defaultValue); bool TryReadValue(int hash, out int output, int defaultValue); bool TryReadValue(int hash, out uint output, uint defaultValue); bool TryReadValue(int hash, out long output, long defaultValue); bool TryReadValue(int hash, out ulong output, ulong defaultValue); bool TryReadValue(int hash, out float output, float defaultValue); bool TryReadValue(int hash, out double output, double defaultValue); bool TryReadValue(int hash, out Vector2 output, Vector2 defaultValue); bool TryReadValue(int hash, out Vector3 output, Vector3 defaultValue); bool TryReadValue(int hash, out Vector4 output, Vector4 defaultValue); bool TryReadValue(int hash, out Vector2Int output, Vector2Int defaultValue); bool TryReadValue(int hash, out Vector3Int output, Vector3Int defaultValue); bool TryReadValue(int hash, out Quaternion output, Quaternion defaultValue); bool TryReadValue(int hash, out Color output, Color defaultValue); bool TryReadValue(int hash, out Color32 output, Color32 defaultValue); bool TryReadValue(int hash, out Guid output); bool TryReadValue(int hash, out DateTime output, DateTime defaultValue); bool TryReadValue(int hash, out string output, string defaultValue); bool TryReadValues(int hash, out bool[] output, bool[] defaultValues); bool TryReadValues(int hash, out byte[] output, byte[] defaultValues); bool TryReadValues(int hash, out sbyte[] output, sbyte[] defaultValues); bool TryReadValues(int hash, out char[] output, char[] defaultValues); bool TryReadValues(int hash, out short[] output, short[] defaultValues); bool TryReadValues(int hash, out ushort[] output, ushort[] defaultValues); bool TryReadValues(int hash, out int[] output, int[] defaultValues); bool TryReadValues(int hash, out uint[] output, uint[] defaultValues); bool TryReadValues(int hash, out long[] output, long[] defaultValues); bool TryReadValues(int hash, out ulong[] output, ulong[] defaultValues); bool TryReadValues(int hash, out float[] output, float[] defaultValues); bool TryReadValues(int hash, out double[] output, double[] defaultValues); bool TryReadValues(int hash, out string[] output, string[] defaultValues); bool TryReadValues(int hash, out Vector2[] output, Vector2[] defaultValues); bool TryReadValues(int hash, out Vector3[] output, Vector3[] defaultValues); bool TryReadValues(int hash, out Vector4[] output, Vector4[] defaultValues); bool TryReadValues(int hash, out Vector2Int[] output, Vector2Int[] defaultValues); bool TryReadValues(int hash, out Vector3Int[] output, Vector3Int[] defaultValues); bool TryReadValues(int hash, out Quaternion[] output, Quaternion[] defaultValues); bool TryReadValues(int hash, out Color[] output, Color[] defaultValues); bool TryReadValues(int hash, out Color32[] output, Color32[] defaultValues); bool TryReadValues(int hash, out Guid[] output); bool TryReadValues(int hash, List output); bool TryReadValues(int hash, List output); bool TryReadValues(int hash, List output); bool TryReadValues(int hash, List output); bool TryReadValues(int hash, List output); bool TryReadValues(int hash, List output); bool TryReadValues(int hash, List output); bool TryReadValues(int hash, List output); bool TryReadValues(int hash, List output); bool TryReadValues(int hash, List output); bool TryReadValues(int hash, List output); bool TryReadValues(int hash, List output); bool TryReadValues(int hash, List output); bool TryReadValues(int hash, List output); bool TryReadValues(int hash, List output); bool TryReadValues(int hash, List output); bool TryReadValues(int hash, List output); bool TryReadValues(int hash, List output); bool TryReadValues(int hash, List output); bool TryReadValues(int hash, List output); bool TryReadValues(int hash, List output); bool TryReadValues(int hash, List output); bool TryReadSerializable(int hash, out T output, T defaultValue); bool TryReadSerializables(int hash, out T[] output, T[] defaultValue); bool TryReadSerializables(int hash, List output); bool TryReadComponentReference(int hash, out T output, NeoSerializedGameObject pathFrom) where T : class; bool TryReadTransformReference(int hash, out Transform output, NeoSerializedGameObject pathFrom); bool TryReadGameObjectReference(int hash, out GameObject output, NeoSerializedGameObject pathFrom); bool TryReadNeoSerializedGameObjectReference(int hash, out NeoSerializedGameObject output, NeoSerializedGameObject pathFrom); } }