Skip to content

Assistant serialization #481

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

Merged
merged 2 commits into from
Dec 3, 2018
Merged
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
18 changes: 17 additions & 1 deletion Scripts/Services/Assistant/v2/Models/MessageInput.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*
*/
using FullSerializer;
using FullSerializer.Internal;
using System;
using System.Collections.Generic;
using System.Runtime.Serialization;
Expand Down Expand Up @@ -86,7 +87,22 @@ public override bool CanProcess(Type type)

public override fsResult TryDeserialize(fsData data, ref object instance, Type storageType)
{
throw new NotImplementedException();
if (data.IsString == false)
{
return fsResult.Fail("Type converter requires a string");
}

instance = fsTypeCache.GetType(data.AsString);
if (instance == null)
{
return fsResult.Fail("Unable to find type " + data.AsString);
}
return fsResult.Success;
}

public override object CreateInstance(fsData data, Type storageType)
{
return new MessageInput();
}

public override fsResult TrySerialize(object instance, out fsData serialized, Type storageType)
Expand Down