tiles and lines
This commit is contained in:
parent
9085f4d5cb
commit
b21a7c7ef2
4 changed files with 160 additions and 14 deletions
|
@ -27,6 +27,7 @@ namespace Sledgemapper.Shared.Entities
|
|||
Overlays = new ConcurrentDictionary<string, Overlay>();
|
||||
Walls = new ConcurrentDictionary<string, Wall>();
|
||||
Notes = new ConcurrentDictionary<string, Note>();
|
||||
Lines=new ConcurrentDictionary<string, Line>();
|
||||
Players = new List<Player>();
|
||||
Colors = new List<string>();
|
||||
}
|
||||
|
@ -40,6 +41,7 @@ namespace Sledgemapper.Shared.Entities
|
|||
public List<string> Colors { get; set; }
|
||||
public string SessionName { get; set; }
|
||||
public int SessionId { get; set; }
|
||||
public ConcurrentDictionary<string, Line> Lines { get; private set; }
|
||||
|
||||
public void NewTile(Tile selectedTile, string tileId)
|
||||
{
|
||||
|
@ -179,5 +181,25 @@ namespace Sledgemapper.Shared.Entities
|
|||
{
|
||||
MapEntityDeleted?.Invoke(this, e);
|
||||
}
|
||||
|
||||
public void NewLine(Line line)
|
||||
{
|
||||
if (line is null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var lineExist = Lines.TryGetValue(line.ToString(), out var tile);
|
||||
var newLine = new Line { X = line.X, Y = line.Y,EndX=line.EndX, EndY=line.EndY };
|
||||
if (lineExist)
|
||||
{
|
||||
Lines.TryRemove(line.ToString(), out var _);
|
||||
}
|
||||
|
||||
Lines.TryAdd(newLine.ToString(), newLine);
|
||||
|
||||
//TODO fix this
|
||||
//OnRaiseMapEntityAddedEvent(new MapEntityAddedEventArgs(newTile));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue