OSDN Git Service

indentation
[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                 public long? EntityId;
18         }
19
20         public class PointsOfInterest : KeyedCollection<BlockPos, PointOfInterest>
21         {
22                 protected override BlockPos GetKeyForItem(PointOfInterest item)
23                 {
24                         return item.Location;
25                 }
26
27                 internal void AddReplace(PointOfInterest poi)
28                 {
29                         if (this.Contains(poi.Location))
30                         {
31                                 this.Remove(poi.Location);
32                                 this.Add(poi);
33                         }
34                         else
35                         {
36                                 this.Add(poi);
37                         }
38
39                 }
40         }
41
42 }
43