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
{
/// <summary>
/// Actual Physical Point in space - that is interesting.
/// </summary>
+ [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<BlockPos, PointOfInterest>