refactoring

This commit is contained in:
Michele Scandura 2020-11-05 20:03:01 +00:00
parent c293490995
commit 4dfbcff460
14 changed files with 240 additions and 82 deletions

View file

@ -0,0 +1,18 @@
namespace Sledgemapper.Shared.Entities
{
public class Overlay
{
public int X { get; set; }
public int Y { get; set; }
public string ID { get; set; }
public bool Intersection { get; set; }
public int Rotation { get; set; }
public override string ToString()
{
return $"{X}_{Y}_{Intersection}";
}
}
}

View file

@ -0,0 +1,11 @@
namespace Sledgemapper.Shared.Entities
{
public class Player
{
public string ConnectionId { get; set; }
public string Color { get; set; }
public string Initials { get; set; }
public Tile Position { get; set; }
}
}

View file

@ -0,0 +1,24 @@
using System.Collections.Generic;
using System.Collections.Concurrent ;
namespace Sledgemapper.Shared.Entities
{
public class SessionData
{
public SessionData()
{
Map = new ConcurrentDictionary<string, Tile>();
Overlays = new ConcurrentDictionary<string, Overlay>();
Walls = new ConcurrentDictionary<string, Wall>();
Players = new List< Player>();
Colors = new List<string>();
}
public ConcurrentDictionary<string, Tile> Map { get; set; }
public ConcurrentDictionary<string, Wall> Walls { get; set; }
public ConcurrentDictionary<string, Overlay> Overlays { get; set; }
public bool IsValid { get; set; }
public List< Player> Players { get; set; }
public List<string> Colors;
}
}

View file

@ -0,0 +1,19 @@
namespace Sledgemapper.Shared.Entities
{
public class Tile
{
public int X { get; set; }
public int Y { get; set; }
public string ID { get; set; }
public int Rotation { get; set; }
public override string ToString()
{
return $"{X}_{Y}";
}
}
}

View file

@ -0,0 +1,16 @@
namespace Sledgemapper.Shared.Entities
{
public class Wall
{
public int X { get; set; }
public int Y { get; set; }
public string ID { get; set; }
public int Rotation { get; set; }
public override string ToString()
{
return $"{X}_{Y}";
}
}
}