OSDN Git Service

Pre-RC0: added Name to POI Metadata.js, Pass 2.5
authormelchior <melchior@users.osdn.me>
Sun, 5 Apr 2020 23:00:17 +0000 (19:00 -0400)
committermelchior <melchior@users.osdn.me>
Sun, 5 Apr 2020 23:00:17 +0000 (19:00 -0400)
TODO: The Rockmap still

Automap/Data/EntitiesOfInterest.cs
Automap/Data/PointOfInterest.cs
Automap/Subsystems/JsonGenerator.cs

index e006d3c..add5406 100644 (file)
@@ -20,23 +20,24 @@ namespace Automap
        [ProtoContract]
        public struct EntityOfInterest
        {
-               
+
+               [DisplayName(0, "Name")]
                [ProtoMember(1)]
                public string Name;
                
-               [DisplayName(1, "Notes")]
+               [DisplayName(2, "Notes")]
                [ProtoMember(2)]
                public string Notes;
 
-               [DisplayName(0, "Loc.")]
+               [DisplayName(1, "Loc.")]
                [ProtoMember(3)]
                public BlockPos Location;
 
-               [DisplayName(2, "Time")]
+               [DisplayName(3, "Time")]
                [ProtoMember(4)]
                public DateTime Timestamp;
 
-               [DisplayName(3, "ID")]
+               [DisplayName(4, "ID")]
                [ProtoMember(5)]
                public long EntityId;
 
index a65c827..f2bbac3 100644 (file)
@@ -18,18 +18,19 @@ namespace Automap
        [ProtoContract]
        public struct PointOfInterest
        {
+               [DisplayName(0, "Name")]
                [ProtoMember(1)]
                public string Name;
 
-               [DisplayName(1, "Notes")]
+               [DisplayName(2, "Notes")]
                [ProtoMember(2)]
                public string Notes;
 
-               [DisplayName(0, "Loc.")]
+               [DisplayName(1, "Loc.")]
                [ProtoMember(3)]
                public BlockPos Location;
 
-               [DisplayName(2, "Time")]
+               [DisplayName(3, "Time")]
                [ProtoMember(4)]
                public DateTime Timestamp;
 
index 116d03b..23cfdcb 100644 (file)
@@ -95,8 +95,9 @@ vfc.chunkMetadata = new Map([['the keys we have', [...metadatas in the same orde
                jsonWriter.WriteStartArray( );
                jsonWriter.WriteValue(chunkTopMetadata.North_mostChunk);
                jsonWriter.WriteValue(chunkTopMetadata.East_mostChunk);
+               jsonWriter.WriteValue(chunkTopMetadata.West_mostChunk);
                jsonWriter.WriteValue(chunkTopMetadata.South_mostChunk);                
-               jsonWriter.WriteValue(chunkTopMetadata.West_mostChunk);         
+               
                jsonWriter.WriteEndArray( );
                jsonWriter.WriteRaw(";\n");
                                                        
@@ -119,58 +120,51 @@ vfc.chunkMetadata = new Map([['the keys we have', [...metadatas in the same orde
 
 
                foreach (var shard in chunkTopMetadata) {
-               //TODO:Flatten to array of values...Dynamism!
+               //TODO:Flatten to array of values...MATCH ORDER OF 'chunkMetadataNames'
                jsonWriter.WriteStartArray( );//Start tuple
                jsonWriter.WriteValue($"{shard.Location.X}_{shard.Location.Y}");//Key of Tuple
 
-               jsonWriter.WriteStartObject( );
-               jsonWriter.WritePropertyName("prettyCoord");
+               jsonWriter.WriteStartArray( );//Start pile-o-values
                jsonWriter.WriteValue(shard.Location.PrettyCoords(ClientAPI));
-
-               jsonWriter.WritePropertyName("chunkAge");
+                                                               
                jsonWriter.WriteValue(shard.ChunkAge);
-
-               jsonWriter.WritePropertyName("temp");
-               jsonWriter.WriteValue(shard.Temperature);
-
-               jsonWriter.WritePropertyName("YMax");
+                                                               
+               jsonWriter.WriteValue(shard.Temperature.ToString("F1"));
+                                                               
                jsonWriter.WriteValue(shard.YMax);
-
-               jsonWriter.WritePropertyName("fert");
-               jsonWriter.WriteValue(shard.Fertility);
-
-               jsonWriter.WritePropertyName("forestDens");
-               jsonWriter.WriteValue(shard.ForestDensity);
-
-               jsonWriter.WritePropertyName("rain");
-               jsonWriter.WriteValue(shard.Rainfall);
-
-               jsonWriter.WritePropertyName("shrubDens");
-               jsonWriter.WriteValue(shard.ShrubDensity);
-
-               jsonWriter.WritePropertyName("airBlocks");
+                                                               
+               jsonWriter.WriteValue(shard.Fertility.ToString("F1"));
+                                                               
+               jsonWriter.WriteValue(shard.ForestDensity.ToString("F1"));
+                                                               
+               jsonWriter.WriteValue(shard.Rainfall.ToString("F1"));
+                                                               
+               jsonWriter.WriteValue(shard.ShrubDensity.ToString("F1"));
+                                                               
                jsonWriter.WriteValue(shard.AirBlocks);
-
-               jsonWriter.WritePropertyName("nonAirBlocks");
+                                                               
                jsonWriter.WriteValue(shard.NonAirBlocks);
 
                //TODO: Heightmap ?
                //Start rockMap ; FOR a Ratio....on tooltip GUI
+               /*
                jsonWriter.WritePropertyName("rockRatio");
                jsonWriter.WriteStartConstructor("Map");
                jsonWriter.WriteStartArray( );
                foreach (var rockEntry in shard.RockRatio) {
                var rockBlock = ClientAPI.World.GetBlock(rockEntry.Key);
                jsonWriter.WriteStartArray( );
-               jsonWriter.WriteValue(rockBlock.Code.Path);
+               jsonWriter.WriteValue(rockBlock.Code.Path);//TODO: Convert to - Singular material type inorder
                jsonWriter.WriteValue(rockEntry.Value);//Total per chunk-column
                jsonWriter.WriteEndArray( );
                }
                jsonWriter.WriteEndArray( );
                jsonWriter.WriteEndConstructor( );//end rock-map
+               */
+               
+               jsonWriter.WriteEndArray( );//end pile-o-values
 
-               jsonWriter.WriteEndObject( );//end Map value: {Object}
-               jsonWriter.WriteEndArray( );//end Tuple
+               jsonWriter.WriteEndArray( );//end Map tuple
                }
 
                jsonWriter.WriteEndArray( );//Enclose tuples of chunkMetadata
@@ -194,7 +188,7 @@ vfc.chunkMetadata = new Map([['the keys we have', [...metadatas in the same orde
                jsonWriter.WriteRaw(";\n");
 
                jsonWriter.WriteWhitespace("\n");
-               jsonWriter.WriteComment("============= BlockID's for Rockmap / Rock-ratios ===============");
+               jsonWriter.WriteComment("============= Block Code's for Rockmap / Rock-ratios ===============");
                jsonWriter.WriteWhitespace("\n");
 
                jsonWriter.WriteRaw("ViewFrame.chunks.rock_Lookup =");
@@ -235,7 +229,7 @@ vfc.chunkMetadata = new Map([['the keys we have', [...metadatas in the same orde
                jsonWriter.WriteValue($"{@this.Location.X}_{@this.Location.Z}");
 
                jsonWriter.WriteStartArray( );
-               //jsonWriter.WriteValue(@this.Name);
+               jsonWriter.WriteValue(@this.Name);
 
                jsonWriter.WriteValue(@this.Location.X);
                jsonWriter.WriteValue(@this.Location.Z); //Y is HEIGHT from Mantle... Z is Right from edge of world
@@ -257,7 +251,7 @@ vfc.chunkMetadata = new Map([['the keys we have', [...metadatas in the same orde
 
 
                jsonWriter.WriteStartArray( );
-               //jsonWriter.WriteValue(@this.Name);
+               jsonWriter.WriteValue(@this.Name);
 
                jsonWriter.WriteValue(@this.Location.X);
                jsonWriter.WriteValue(@this.Location.Z); //Y is HEIGHT from Mantle... Z is Right from edge of world