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

[server] Get the LineIncubator to emit OnLinePartAddition events

This commit is contained in:
Starbeamrainbowlabs 2017-06-27 14:42:36 +01:00
parent 058511be19
commit ecbece8f22

View file

@ -7,6 +7,10 @@ namespace Nibriboard.Client
{
public class LinePartEventArgs : EventArgs
{
/// <summary>
/// The client who drew the additional points.
/// </summary>
public NibriClient DrawingClient;
/// <summary>
/// The id of the line that justu had some points added to it.
/// </summary>
@ -14,7 +18,7 @@ namespace Nibriboard.Client
/// <summary>
/// The new points that got added to the line.
/// </summary>
public List<DrawnLine> NewLineParts;
public List<LocationReference> NewPoints;
}
public delegate void OnLinePartAddition(object sender, LinePartEventArgs eventArgs);
@ -68,7 +72,7 @@ namespace Nibriboard.Client
/// </summary>
/// <param name="lineId">The line id to add the points to.</param>
/// <param name="points">The points to add to the lines.</param>
public void AddBit(string lineId, List<LocationReference> points)
public void AddBit(NibriClient drawingClient, string lineId, List<LocationReference> points)
{
// Create a new line if one doesn't exist already
if(!currentLines.ContainsKey(lineId))
@ -76,6 +80,12 @@ namespace Nibriboard.Client
// Add these points to the line
currentLines[lineId].Points.AddRange(points);
OnLinePartAddition(this, new LinePartEventArgs() {
DrawingClient = drawingClient,
LineId = lineId,
NewPoints = points
});
}
/// <summary>