1
0
Fork 0
mirror of https://github.com/sbrl/Nibriboard.git synced 2018-01-10 21:33:49 +00:00

[server] Add continues from/with id properties

This commit is contained in:
Starbeamrainbowlabs 2017-09-29 15:42:14 +01:00
parent 4f485720b2
commit 54f5d3bd3f

View file

@ -72,6 +72,11 @@ namespace Nibriboard.RippleSpace
/// </summary>
[JsonProperty]
public ChunkReference ContinuesIn = null;
/// <summary>
/// The id of the line that this line fragment is continued by.
/// </summary>
[JsonProperty]
public string ContinuesWithId = null;
/// <summary>
/// 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
/// </summary>
[JsonProperty]
public ChunkReference ContinuesFrom = null;
/// <summary>
/// The id of the line fragment that this line continues from.
/// </summary>
[JsonProperty]
public string ContinuesFromId = null;
/// <summary>
/// Gets a reference in chunk-space ot the chunk that this line starts in.
/// </summary>
/// </summary>
[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;