before deleting Rules
This commit is contained in:
@@ -6,7 +6,7 @@ namespace Gameboard.ShogiUI.Sockets.Managers
|
||||
public interface IBoardManager
|
||||
{
|
||||
void Add(string sessionName, ShogiBoard board);
|
||||
ShogiBoard Get(string sessionName);
|
||||
ShogiBoard? Get(string sessionName);
|
||||
}
|
||||
|
||||
public class BoardManager : IBoardManager
|
||||
@@ -20,10 +20,12 @@ namespace Gameboard.ShogiUI.Sockets.Managers
|
||||
|
||||
public void Add(string sessionName, ShogiBoard board) => Boards.TryAdd(sessionName, board);
|
||||
|
||||
public ShogiBoard Get(string sessionName)
|
||||
public ShogiBoard? Get(string sessionName)
|
||||
{
|
||||
if (Boards.TryGetValue(sessionName, out var board))
|
||||
{
|
||||
return board;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user