39 lines
947 B
C#
39 lines
947 B
C#
using MauMau_Server.Mau;
|
|
using MauMau_Server.Websockets;
|
|
|
|
namespace MauMau_Server.Room;
|
|
|
|
public class Lobby : RoomType
|
|
{
|
|
private readonly Room _room;
|
|
|
|
public Lobby(Room room)
|
|
{
|
|
_room = room;
|
|
}
|
|
|
|
public Lobby(Room room, ConnectionInstance connection)
|
|
{
|
|
_room = room;
|
|
Console.WriteLine(connection.Name + " won the game!");
|
|
}
|
|
|
|
public void OnMessage(ConnectionInstance sender, string message)
|
|
{
|
|
// TODO: Add a way to change game settings
|
|
if (sender == _room._host)
|
|
{
|
|
_room._roomType = new Game(_room, _room.Connections);
|
|
}
|
|
}
|
|
|
|
public void OnConnect(ConnectionInstance connection)
|
|
{
|
|
var roomMessage = new RoomMessage("LOBBY", MessageType.INFO, _room.Connections, connection.Name + " joined!");
|
|
}
|
|
|
|
public void OnDisconnect(ConnectionInstance connection)
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
} |