Add project files.
This commit is contained in:
40
WinGreed/HandleThrow.cs
Normal file
40
WinGreed/HandleThrow.cs
Normal file
@ -0,0 +1,40 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace WinGreed
|
||||
{
|
||||
public class HandleThrow
|
||||
{
|
||||
public string Who { get; set; }
|
||||
public int Score { get; set; }
|
||||
|
||||
private List<Dice> _dices = new List<Dice>();
|
||||
int roll;
|
||||
public HandleThrow()
|
||||
{
|
||||
for (int i = 1; i < 7; i++)
|
||||
{
|
||||
_dices.Add(new Dice(i));
|
||||
}
|
||||
roll = 0;
|
||||
}
|
||||
|
||||
public List<Dice> Throw()
|
||||
{
|
||||
var rolled = new List<Dice>();
|
||||
roll += 1;
|
||||
foreach (Dice dice in _dices)
|
||||
{
|
||||
if (!dice.Chosen)
|
||||
{
|
||||
dice.Roll();
|
||||
rolled.Add(dice);
|
||||
}
|
||||
}
|
||||
return rolled;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user