forked from Shardstone/trail-into-darkness
16 lines
566 B
C#
16 lines
566 B
C#
using System;
|
|
using Newtonsoft.Json;
|
|
|
|
namespace Jovian.InGameLogging {
|
|
public sealed class LogChannelJsonConverter : JsonConverter<LogChannel> {
|
|
public override void WriteJson(JsonWriter writer, LogChannel value, JsonSerializer serializer) {
|
|
writer.WriteValue(value.Id);
|
|
}
|
|
|
|
public override LogChannel ReadJson(JsonReader reader, Type objectType, LogChannel existingValue, bool hasExistingValue, JsonSerializer serializer) {
|
|
var id = reader.Value as string;
|
|
return new LogChannel(id);
|
|
}
|
|
}
|
|
}
|