OSDN Git Service

Merge branch 'vgd' of into Split_renderers
[automap/automap.git] / Automap / Designators / DefaultDesignators.cs
index 19b448e..929d618 100644 (file)
@@ -81,6 +81,8 @@ namespace Automap
                };
                }
 
+               #region Designators
+
                internal static void DecodeSign(ICoreClientAPI clientAPI, PointsOfInterest poi, BlockPos posn, Block block)
                {
 #if DEBUG
@@ -95,9 +97,10 @@ namespace Automap
                                poi.AddReplace(
                                                        new PointOfInterest
                                                        {
+                                                               Name = "Sign",
                                                                Location = posn.Copy(),
                                                                Notes = signEntity.text,
-                                                               Timestamp = DateTimeOffset.UtcNow,
+                                                               Timestamp = DateTime.UtcNow,
                                                        }
                                                        );
 
@@ -120,9 +123,10 @@ namespace Automap
                                poi.AddReplace(
                                                        new PointOfInterest
                                                        {
+                                                               Name = "Signpost",
                                                                Location = posn.Copy(),
                                                                Notes = string.Join(",", signEntity.textByCardinalDirection),
-                                                               Timestamp = DateTimeOffset.UtcNow,
+                                                               Timestamp = DateTime.UtcNow,
                                                        }
                                                        );
 
@@ -131,15 +135,22 @@ namespace Automap
 
                internal static void KeepTrackOfMerchant(ICoreClientAPI clientAPI, EntitiesOfInterest poi, BlockPos posn, Entity entity)
                {
-                       clientAPI.Logger.VerboseDebug("Trader: {0} @ {1}", entity.GetName(), posn);
+                       //clientAPI.Logger.VerboseDebug("Trader: {0} @ {1}", entity.GetName(), posn);
 
-                       var message = $"{entity.GetName()}";
                        var traderJoe = entity as EntityTrader;
+                       var message = $"{entity.GetName()} Alive: {traderJoe.Alive}";
                        if (traderJoe.TradeProps != null)
                        {
-                               message = $"{traderJoe.GetName()} Alive:{traderJoe.Alive} - Gears: {traderJoe.TradeProps.Money}, ";
+                               message += $" - Gears: {traderJoe.TradeProps.Money}, ";
                        }
-                       poi.Upsert(entity, message);
+                       poi.AddReplace(new EntityOfInterest
+                       {
+                               Name = "Trader",
+                               Location = posn.Copy(),
+                               Notes = message,
+                               Timestamp = DateTime.UtcNow,
+                               EntityId = entity.EntityId
+                       });
                }
 
                internal static void DecodeTranslocator(ICoreClientAPI clientAPI, PointsOfInterest poi, BlockPos posn, Block block)
@@ -162,14 +173,17 @@ namespace Automap
                                poi.AddReplace(
                                                        new PointOfInterest
                                                        {
+                                                               Name = "Translocator",
                                                                Location = posn.Copy(),
                                                                Notes = textTarget.ToString(),
-                                                               Timestamp = DateTimeOffset.UtcNow,
+                                                               Timestamp = DateTime.UtcNow,
                                                        }
                                                        );
 
                        }
                }
+
+               #endregion
        }
 }