From 54f5d3bd3f6646b055fb8589f2b4c5b3d0fdebc8 Mon Sep 17 00:00:00 2001 From: Starbeamrainbowlabs Date: Fri, 29 Sep 2017 15:42:14 +0100 Subject: [PATCH] [server] Add continues from/with id properties --- Nibriboard/RippleSpace/DrawnLine.cs | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/Nibriboard/RippleSpace/DrawnLine.cs b/Nibriboard/RippleSpace/DrawnLine.cs index 7e1d662..c00e8a1 100644 --- a/Nibriboard/RippleSpace/DrawnLine.cs +++ b/Nibriboard/RippleSpace/DrawnLine.cs @@ -72,6 +72,11 @@ namespace Nibriboard.RippleSpace /// [JsonProperty] public ChunkReference ContinuesIn = null; + /// + /// The id of the line that this line fragment is continued by. + /// + [JsonProperty] + public string ContinuesWithId = null; /// /// The chunk reference of the previous chunk that contains the line fragment that /// this line continues from. Is null when this line either doesn't continue from @@ -79,10 +84,16 @@ namespace Nibriboard.RippleSpace /// [JsonProperty] public ChunkReference ContinuesFrom = null; + /// + /// The id of the line fragment that this line continues from. + /// + [JsonProperty] + public string ContinuesFromId = null; /// /// Gets a reference in chunk-space ot the chunk that this line starts in. - /// + /// + [JsonProperty] public ChunkReference ContainingChunk { get { if (Points.Count == 0) @@ -146,12 +157,16 @@ namespace Nibriboard.RippleSpace for(int i = 0; i < results.Count - 1; i++) { // Set the ContinuesFrom reference, but not on the first fragment in the list - if(i > 0) + if(i > 0) { results[i].ContinuesFrom = results[i - 1].ContainingChunk; + results[i].ContinuesFromId = results[i - 1].UniqueId; + } // Set the ContinuesIn reference, but not on the last fragment in the list - if(i < results.Count - 1) + if(i < results.Count - 1) { results[i].ContinuesIn = results[i + 1].ContainingChunk; + results[i].ContinuesWithId = results[i + 1].UniqueId; + } } return results;