OSDN Git Service

replaced the static static map with dynamic static map :)
[automap/automap.git] / Automap / Data / PointOfInterest.cs
1 using System;
2 using System.Collections.ObjectModel;
3
4 using Vintagestory.API.Common;
5 using Vintagestory.API.MathTools;
6
7 namespace Automap
8 {
9         /// <summary>
10         /// Actual Physical Point in space - that is interesting.
11         /// </summary>
12         public struct PointOfInterest
13         {
14                 public string Notes;
15                 public BlockPos Location;
16                 public DateTimeOffset Timestamp;
17         }
18
19         public class PointsOfInterest : KeyedCollection<BlockPos, PointOfInterest>
20         {
21                 protected override BlockPos GetKeyForItem(PointOfInterest item)
22                         => item.Location;
23
24                 internal void AddReplace(PointOfInterest poi)
25                 {
26                         if (Contains(poi.Location))
27                                 Remove(poi.Location);
28
29                         Add(poi);
30                 }
31         }
32
33 }
34