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.
47 lines
1.1 KiB
47 lines
1.1 KiB
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
|
|
{
|
|
private string nameTag;
|
|
public ReadOnlyCollection<Tile> Tiles { get; private set; }
|
|
private readonly List<Tile> playerTiles = new List<Tile>();
|
|
|
|
public Player(string name)
|
|
{
|
|
if(name==null || string.IsNullOrEmpty(name))
|
|
{
|
|
throw new ArgumentNullException("name");
|
|
}
|
|
nameTag = name;
|
|
playerTiles = new List<Tile>();
|
|
Tiles = playerTiles.AsReadOnly();
|
|
}
|
|
|
|
public string GetNameTag
|
|
{
|
|
get { return nameTag; }
|
|
set { nameTag = value; }
|
|
}
|
|
|
|
public bool IsPlaying { get; set; } = false;
|
|
|
|
public void AddTilePlayer(Tile tile)
|
|
{
|
|
playerTiles.Add(tile);
|
|
}
|
|
|
|
public bool RemoveTilePlayer(Tile tile)
|
|
{
|
|
return playerTiles.Remove(tile);
|
|
}
|
|
|
|
}
|
|
}
|