refactoring
This commit is contained in:
parent
c293490995
commit
4dfbcff460
14 changed files with 240 additions and 82 deletions
18
Sledgemapper.Shared/Entities/Overlay.cs
Normal file
18
Sledgemapper.Shared/Entities/Overlay.cs
Normal 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}";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
11
Sledgemapper.Shared/Entities/Player.cs
Normal file
11
Sledgemapper.Shared/Entities/Player.cs
Normal 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; }
|
||||
}
|
||||
}
|
24
Sledgemapper.Shared/Entities/SessionData.cs
Normal file
24
Sledgemapper.Shared/Entities/SessionData.cs
Normal 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;
|
||||
}
|
||||
}
|
19
Sledgemapper.Shared/Entities/Tile.cs
Normal file
19
Sledgemapper.Shared/Entities/Tile.cs
Normal 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}";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
16
Sledgemapper.Shared/Entities/Wall.cs
Normal file
16
Sledgemapper.Shared/Entities/Wall.cs
Normal 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}";
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue