Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: update serializer method names #149

Merged
merged 1 commit into from
Aug 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -58,7 +58,7 @@ public virtual JObject Serialize()
throw new Exception("Incompatible object version for serialization");
}

return serializer.SerializeFrom(this);
return serializer.Serialize(this);
}
}
}
Loading