2 using System.Collections.ObjectModel;
4 using Vintagestory.API.Client;
5 using Vintagestory.API.Common;
6 using Vintagestory.API.MathTools;
11 /// Actual Physical Point in space - that is interesting.
13 public struct PointOfInterest
15 [DisplayName(1, "Notes")]
17 [DisplayName(0, "Loc.")]
18 public BlockPos Location;
19 [DisplayName(2, "Time")]
20 public DateTimeOffset Timestamp;
21 public void Write(StreamWriter stream, ICoreClientAPI ClientApi)
23 // this is gross i hate this
24 stream.Write("['{0}_{1}',[",
28 stream.Write("'{0}',", Location.PrettyCoords(ClientApi));
29 stream.Write("'{0}',", System.Web.HttpUtility.HtmlEncode(Notes).Replace("\n", " ").Replace("\\","\\\\"));
30 stream.Write("'{0}',", Timestamp);
35 public class PointsOfInterest : KeyedCollection<BlockPos, PointOfInterest>
37 protected override BlockPos GetKeyForItem(PointOfInterest item)
40 internal void AddReplace(PointOfInterest poi)
42 if (Contains(poi.Location))