X-Git-Url: http://git.osdn.net/view?p=automap%2Fautomap.git;a=blobdiff_plain;f=Automap%2FData%2FPointOfInterest.cs;h=a65c827295604ddb75c6028fba8b142d4005f41d;hp=48769572434baf7968c46d43803fe96b944793e6;hb=01a930a1c73adca96b7f4b23b4cffff18f24c45d;hpb=cdc29d29d788f9126faee33e48c4f65968b49702 diff --git a/Automap/Data/PointOfInterest.cs b/Automap/Data/PointOfInterest.cs index 4876957..a65c827 100644 --- a/Automap/Data/PointOfInterest.cs +++ b/Automap/Data/PointOfInterest.cs @@ -1,35 +1,39 @@ using System; using System.Collections.ObjectModel; using System.IO; + using Vintagestory.API.Client; using Vintagestory.API.Common; using Vintagestory.API.MathTools; +using ProtoBuf; + +using Newtonsoft.Json; + namespace Automap { /// /// Actual Physical Point in space - that is interesting. /// + [ProtoContract] public struct PointOfInterest { + [ProtoMember(1)] + public string Name; + [DisplayName(1, "Notes")] + [ProtoMember(2)] public string Notes; + [DisplayName(0, "Loc.")] + [ProtoMember(3)] public BlockPos Location; + [DisplayName(2, "Time")] - public DateTimeOffset Timestamp; - public void Write(StreamWriter stream, ICoreClientAPI ClientApi) - { - // this is gross i hate this - stream.Write("['{0}_{1}',[", - Location.X, - Location.Y - ); - stream.Write("'{0}',", Location.PrettyCoords(ClientApi)); - stream.Write("'{0}',", System.Web.HttpUtility.HtmlEncode(Notes).Replace("\n", " ").Replace("\\","\\\\")); - stream.Write("'{0}',", Timestamp); - stream.Write("]]"); - } + [ProtoMember(4)] + public DateTime Timestamp; + + } public class PointsOfInterest : KeyedCollection