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:
parent
4f485720b2
commit
54f5d3bd3f
1 changed files with 18 additions and 3 deletions
|
@ -73,16 +73,27 @@ namespace Nibriboard.RippleSpace
|
||||||
[JsonProperty]
|
[JsonProperty]
|
||||||
public ChunkReference ContinuesIn = null;
|
public ChunkReference ContinuesIn = null;
|
||||||
/// <summary>
|
/// <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
|
/// 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
|
/// this line continues from. Is null when this line either doesn't continue from
|
||||||
/// another line fragment or doesn't span multiple chunks.
|
/// another line fragment or doesn't span multiple chunks.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonProperty]
|
[JsonProperty]
|
||||||
public ChunkReference ContinuesFrom = null;
|
public ChunkReference ContinuesFrom = null;
|
||||||
|
/// <summary>
|
||||||
|
/// The id of the line fragment that this line continues from.
|
||||||
|
/// </summary>
|
||||||
|
[JsonProperty]
|
||||||
|
public string ContinuesFromId = null;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets a reference in chunk-space ot the chunk that this line starts in.
|
/// Gets a reference in chunk-space ot the chunk that this line starts in.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[JsonProperty]
|
||||||
public ChunkReference ContainingChunk {
|
public ChunkReference ContainingChunk {
|
||||||
get {
|
get {
|
||||||
if (Points.Count == 0)
|
if (Points.Count == 0)
|
||||||
|
@ -146,12 +157,16 @@ namespace Nibriboard.RippleSpace
|
||||||
for(int i = 0; i < results.Count - 1; i++)
|
for(int i = 0; i < results.Count - 1; i++)
|
||||||
{
|
{
|
||||||
// Set the ContinuesFrom reference, but not on the first fragment in the list
|
// 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].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
|
// 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].ContinuesIn = results[i + 1].ContainingChunk;
|
||||||
|
results[i].ContinuesWithId = results[i + 1].UniqueId;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return results;
|
return results;
|
||||||
|
|
Loading…
Reference in a new issue