You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
40 lines
959 B
40 lines
959 B
using System;
|
|
using System.Collections.Generic;
|
|
using System.Collections.ObjectModel;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace QwirkleClassLibrary
|
|
{
|
|
public class Player
|
|
{
|
|
public ReadOnlyCollection<Tile> Tiles => playerTiles.AsReadOnly();
|
|
private readonly List<Tile> playerTiles = new();
|
|
|
|
public Player(string name)
|
|
{
|
|
if(name == null || string.IsNullOrEmpty(name))
|
|
{
|
|
throw new ArgumentNullException(name);
|
|
}
|
|
|
|
NameTag = name;
|
|
}
|
|
|
|
public string NameTag { get; }
|
|
|
|
public bool IsPlaying { get; set; } = false;
|
|
|
|
public void AddTileToPlayer(Tile tile)
|
|
{
|
|
playerTiles.Add(tile);
|
|
}
|
|
|
|
public bool RemoveTileToPlayer(Tile tile)
|
|
{
|
|
return playerTiles.Remove(tile);
|
|
}
|
|
}
|
|
}
|