Merge pull request 'Modification de Game.cs' (#46) from regleDuJeu into dev

Reviewed-on: #46
Reviewed-by: Rémi LAVERGNE <remi.lavergne@etu.uca.fr>
pull/53/head
Rémi LAVERGNE 1 year ago
commit 3cdb4b5dce

@ -17,6 +17,8 @@ namespace Models.Game
public int Turn { get; set; } public int Turn { get; set; }
public Rules.Rules rules { get; set; }
public Game(Player player,Map map) public Game(Player player,Map map)
{ {
@ -25,6 +27,7 @@ namespace Models.Game
De1 = new De(); De1 = new De();
De2 = new De(1); De2 = new De(1);
Turn = 0; Turn = 0;
rules = new Rules.Rules();
} }
public void ThrowDice() public void ThrowDice()
@ -33,7 +36,7 @@ namespace Models.Game
De2.Lancer(); De2.Lancer();
} }
public int ChooseOperation(Operation o) public int ResultOperation(Operation o)
{ {
switch (o) switch (o)
{ {
@ -67,5 +70,27 @@ namespace Models.Game
return 0; return 0;
} }
} }
public void PlaceResult (Cell playerChoice,int result)
{
if (Turn == 1)
{
playerChoice.Value = result;
}
else
{
if(rules.NearCell(playerChoice,NameMap.Cells))
{
playerChoice.Value = result;
}
}
return;
}
public void AddRopeZone(Cell playerChoice,RopesZones list)
{
}
} }
} }

@ -1,14 +1,14 @@
namespace Models.Game; namespace Models.Game;
public class Map public class Map
{ {
public List<Cell> Cells { get; private set; } public List<Cell> Cells { get; private set; }
public string Background { get; private set; } public string Background { get; private set; }
public Map(List<Cell> cells, string background) public Map(List<Cell> cells, string background)
{ {
Cells = cells; Cells = cells;
Background = background; Background = background;
} }
} }

@ -1,28 +1,28 @@
namespace Models.Game; namespace Models.Game;
public class Player public class Player
{ {
public string Pseudo { get; private set; } public string Pseudo { get; private set; }
public string ProfilePicture { get; private set; } public string ProfilePicture { get; private set; }
public Player() public Player()
{ {
Pseudo = "Player"; Pseudo = "Player";
ProfilePicture = "DefaultProfilePicture"; ProfilePicture = "DefaultProfilePicture";
} }
public Player(string pseudo, string profilePicture = "DefaultProfilePicture") public Player(string pseudo, string profilePicture = "DefaultProfilePicture")
{ {
Pseudo = pseudo; Pseudo = pseudo;
ProfilePicture = profilePicture; ProfilePicture = profilePicture;
} }
public Operation ChooseOperation() public Operation ChooseOperation()
{ {
return Operation.LOWER return Operation.LOWER;
} }
} }

@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Models.Game
{
public class RopesZones
{
public List<List<Cell>>? RopeZone { get; set; }
}
}
Loading…
Cancel
Save