From ad8f392e01c54245f7a92fb039f97215b29ddf10 Mon Sep 17 00:00:00 2001 From: poi-vrc <77053052+poi-vrc@users.noreply.github.com> Date: Wed, 23 Aug 2023 15:01:37 +0800 Subject: [PATCH] refactor: update serializer method names --- .../Lib/Runtime/Wearable/Serializers/ISerializer.cs | 4 ++-- .../Lib/Runtime/Wearable/Serializers/Version1Serializer.cs | 4 ++-- .../Lib/Runtime/Wearable/WearableConfigVersionedObject.cs | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/Wearable/Serializers/ISerializer.cs b/Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/Wearable/Serializers/ISerializer.cs index 262d4413..b650a88e 100644 --- a/Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/Wearable/Serializers/ISerializer.cs +++ b/Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/Wearable/Serializers/ISerializer.cs @@ -26,7 +26,7 @@ namespace Chocopoi.DressingTools.Lib.Wearable.Serializers { public interface ISerializer { - JObject SerializeFrom(object obj); - void DeserializeFrom(object obj, JObject jObject); + JObject Serialize(object obj); + void Deserialize(object obj, JObject jObject); } } diff --git a/Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/Wearable/Serializers/Version1Serializer.cs b/Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/Wearable/Serializers/Version1Serializer.cs index 5e2d86ae..b3a6f735 100644 --- a/Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/Wearable/Serializers/Version1Serializer.cs +++ b/Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/Wearable/Serializers/Version1Serializer.cs @@ -95,7 +95,7 @@ private static WearableModule DeserializeModule(JObject jObject) private const string KeyAvatarConfig = "avatarConfig"; private const string KeyModules = "modules"; - public void DeserializeFrom(object obj, JObject jObject) + public void Deserialize(object obj, JObject jObject) { // TODO: perform schema check here var config = (WearableConfig)obj; @@ -127,7 +127,7 @@ public void DeserializeFrom(object obj, JObject jObject) } } - public JObject SerializeFrom(object obj) + public JObject Serialize(object obj) { var config = (WearableConfig)obj; var jObject = new JObject diff --git a/Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/Wearable/WearableConfigVersionedObject.cs b/Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/Wearable/WearableConfigVersionedObject.cs index 4e8e9972..dec6bc2e 100644 --- a/Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/Wearable/WearableConfigVersionedObject.cs +++ b/Packages/com.chocopoi.vrc.dressingtools/Lib/Runtime/Wearable/WearableConfigVersionedObject.cs @@ -46,7 +46,7 @@ public virtual void DeserializeFrom(JObject jObject) throw new Exception("Incompatible object version for deserialization"); } - serializer.DeserializeFrom(this, jObject); + serializer.Deserialize(this, jObject); } public virtual JObject Serialize() @@ -58,7 +58,7 @@ public virtual JObject Serialize() throw new Exception("Incompatible object version for serialization"); } - return serializer.SerializeFrom(this); + return serializer.Serialize(this); } } }