refactor and chat base

This commit is contained in:
2023-04-22 12:42:02 +02:00
parent 2c7e7303bc
commit e4769d4b99
11 changed files with 231 additions and 144 deletions

View File

@@ -1,20 +1,17 @@
using System.Net.WebSockets;
using MauMau_Server.Websockets;
namespace MauMau_Server.Mau;
public class Player
{
public string Name { get; set; }
public string PlayerId { get; set; }
public WebSocket Socket { get; set; }
public ConnectionInstance Connection { get; set; }
public List<Card> Hand { get; set; } = new();
public Player(string name, string playerId, WebSocket socket)
public Player(ConnectionInstance connection)
{
Name = name;
PlayerId = playerId;
Socket = socket;
Connection = connection;
}
public bool IsMe(string playerId) => PlayerId == playerId;
public bool IsMe(string playerId) => Connection.ConnectionId == playerId;
}