OSDN Git Service

Merge branch 'vgd' of into Split_renderers
[automap/automap.git] / Automap / Data / EntitiesOfInterest.cs
index 1da27e9..e006d3c 100644 (file)
@@ -3,38 +3,44 @@ using System.Collections.Generic;
 using System.Collections.ObjectModel;
 using System.IO;
 using System.Linq;
+
 using Vintagestory.API.Common.Entities;
 using Vintagestory.API.MathTools;
 using Vintagestory.API.Client;
 
+using ProtoBuf;
+
+using Newtonsoft.Json;
+
 namespace Automap
 {
        /// <summary>
        /// Basically the same as a POI but for an entity
        /// </summary>
+       [ProtoContract]
        public struct EntityOfInterest
        {
+               
+               [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;
+               [ProtoMember(4)]
+               public DateTime Timestamp;
+
                [DisplayName(3, "ID")]
+               [ProtoMember(5)]
                public long EntityId;
-               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));
-                       stream.Write("'{0}',", Timestamp);
-                       stream.Write("'{0}',", EntityId);
-                       stream.Write("]]");
-               }
+
+
        }
 
        /// <summary>