|
|
@ -8,16 +8,16 @@ namespace Models.Game
|
|
|
|
{
|
|
|
|
{
|
|
|
|
public class Game
|
|
|
|
public class Game
|
|
|
|
{
|
|
|
|
{
|
|
|
|
public Player CurrentPlayer { get; set; }
|
|
|
|
public Player CurrentPlayer { get; private set; }
|
|
|
|
|
|
|
|
|
|
|
|
private Map UsedMap { get; set; }
|
|
|
|
public Map UsedMap { get; private set; }
|
|
|
|
|
|
|
|
|
|
|
|
private Dice Dice1 { get; set; }
|
|
|
|
private Dice Dice1 { get; }
|
|
|
|
private Dice Dice2 { get; set; }
|
|
|
|
private Dice Dice2 { get; }
|
|
|
|
|
|
|
|
|
|
|
|
private int Turn { get; set; }
|
|
|
|
private int Turn { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
private Rules.Rules Rules { get; set; }
|
|
|
|
private Rules.Rules GameRules { get; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public Game(Player player,Map map)
|
|
|
|
public Game(Player player,Map map)
|
|
|
@ -27,10 +27,10 @@ namespace Models.Game
|
|
|
|
Dice1 = new Dice();
|
|
|
|
Dice1 = new Dice();
|
|
|
|
Dice2 = new Dice(1);
|
|
|
|
Dice2 = new Dice(1);
|
|
|
|
Turn = 0;
|
|
|
|
Turn = 0;
|
|
|
|
Rules = new Rules.Rules();
|
|
|
|
GameRules = new Rules.Rules();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void ThrowDice()
|
|
|
|
public void RollAllDice()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Dice1.Lancer();
|
|
|
|
Dice1.Lancer();
|
|
|
|
Dice2.Lancer();
|
|
|
|
Dice2.Lancer();
|
|
|
@ -54,6 +54,7 @@ namespace Models.Game
|
|
|
|
|
|
|
|
|
|
|
|
case Operation.MULTIPLICATION:
|
|
|
|
case Operation.MULTIPLICATION:
|
|
|
|
return Dice2.Nb * Dice1.Nb;
|
|
|
|
return Dice2.Nb * Dice1.Nb;
|
|
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
return 0;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -61,17 +62,10 @@ namespace Models.Game
|
|
|
|
|
|
|
|
|
|
|
|
public void PlaceResult (Cell playerChoice,int result)
|
|
|
|
public void PlaceResult (Cell playerChoice,int result)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (Turn == 1)
|
|
|
|
if (Turn == 1 || GameRules.NearCell(playerChoice, UsedMap.Cells))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
playerChoice.Value = result;
|
|
|
|
playerChoice.Value = result;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if(Rules.NearCell(playerChoice,UsedMap.Cells))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
playerChoice.Value = result;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void AddRopeZone(Cell playerChoice,RopesZones list)
|
|
|
|
public void AddRopeZone(Cell playerChoice,RopesZones list)
|
|
|
|