|
|
|
@ -76,7 +76,7 @@ class Program
|
|
|
|
|
static void OnDiceRolled(object sender, DiceRolledEventArgs e)
|
|
|
|
|
{
|
|
|
|
|
Console.WriteLine($"Dice 1: {e.Dice1Value} | Dice 2: {e.Dice2Value}");
|
|
|
|
|
Operation playerOperation = GetPlayerOperation();
|
|
|
|
|
Operation playerOperation = GetPlayerOperation(sender);
|
|
|
|
|
((Game)sender).HandlePlayerOperation(playerOperation);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -230,7 +230,7 @@ class Program
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
/// <exception cref="ArgumentOutOfRangeException"></exception>
|
|
|
|
|
static Operation GetPlayerOperation()
|
|
|
|
|
static Operation GetPlayerOperation(object? sender)
|
|
|
|
|
{
|
|
|
|
|
DisplayOperationOptions();
|
|
|
|
|
string? op = Console.ReadLine();
|
|
|
|
@ -239,6 +239,14 @@ class Program
|
|
|
|
|
Console.WriteLine("Invalid operation. Please choose again.");
|
|
|
|
|
op = Console.ReadLine();
|
|
|
|
|
}
|
|
|
|
|
int test = Convert.ToInt32(op);
|
|
|
|
|
while(((Game)sender).UsedMap.CheckOperationPossible(test-1))
|
|
|
|
|
{
|
|
|
|
|
Console.WriteLine("Invalid operation. Please choose again.");
|
|
|
|
|
Console.WriteLine();
|
|
|
|
|
op = Console.ReadLine();
|
|
|
|
|
test = Convert.ToInt32(op);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return op switch
|
|
|
|
|
{
|
|
|
|
|