2 using System.Collections.Generic;
3 using System.Collections.ObjectModel;
7 using Vintagestory.API.Common.Entities;
12 /// Entities of interest.
14 /// <remarks>Tracked by ID - these never leave.</remarks>
15 public class EntitiesOfInterest
17 private Dictionary<long, PointOfInterest> entitySet = new Dictionary<long, PointOfInterest>(50);
20 internal void Upsert(Entity something, string message = @"")
22 if (entitySet.ContainsKey(something.EntityId))
24 var movingPOI = entitySet[something.EntityId];
25 movingPOI.Location = something.Pos.AsBlockPos.Copy();
26 movingPOI.Timestamp = DateTimeOffset.UtcNow;
30 PointOfInterest newPOI = new PointOfInterest();
31 newPOI.EntityId = something.EntityId;
32 newPOI.Location = something.Pos.AsBlockPos.Copy();
33 newPOI.Timestamp = DateTimeOffset.UtcNow;
34 newPOI.Notes = message;
35 entitySet.Add(something.EntityId, newPOI);
41 public List<PointOfInterest> PointsList
44 return entitySet.Values.ToList();