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.
31 lines
623 B
31 lines
623 B
using System.Collections.Generic;
|
|
|
|
namespace Model.Dice
|
|
{
|
|
public abstract class AbstractDie<T> where T : AbstractDieFace
|
|
{
|
|
protected string Name;
|
|
public IEnumerable<T> ListFaces => listFaces;
|
|
|
|
private readonly List<T> listFaces = new();
|
|
|
|
public AbstractDie(string name, params T[] faces)
|
|
{
|
|
Name = name;
|
|
listFaces.AddRange(faces);
|
|
}
|
|
|
|
|
|
|
|
public string GetName() => Name;
|
|
|
|
public abstract AbstractDieFace GetRandomFace();
|
|
|
|
public List<T> GetDieFaces()
|
|
{
|
|
return (List<T>)ListFaces;
|
|
}
|
|
|
|
}
|
|
}
|