Modification de Game.cs

pull/46/head
Lucas DUFLOT 1 year ago
parent 95e45780fb
commit 0593649450

@ -17,6 +17,8 @@ namespace Models.Game
public int Turn { get; set; }
public Rules.Rules rules { get; set; }
public Game(Player player,Map map)
{
@ -25,6 +27,7 @@ namespace Models.Game
De1 = new De();
De2 = new De(1);
Turn = 0;
rules = new Rules.Rules();
}
public void ThrowDice()
@ -33,7 +36,7 @@ namespace Models.Game
De2.Lancer();
}
public int ChooseOperation(Operation o)
public int ResultOperation(Operation o)
{
switch (o)
{
@ -67,5 +70,27 @@ namespace Models.Game
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;
public class Map
{
namespace Models.Game;
public class Map
{
public List<Cell> Cells { get; private set; }
public string Background { get; private set; }
public Map(List<Cell> cells, string background)
{
Cells = cells;
Background = background;
}
public string Background { get; private set; }
public Map(List<Cell> cells, string background)
{
Cells = cells;
Background = background;
}
}

@ -1,28 +1,28 @@
namespace Models.Game;
public class Player
{
namespace Models.Game;
public class Player
{
public string Pseudo { get; private set; }
public string ProfilePicture { get; private set; }
public Player()
{
Pseudo = "Player";
ProfilePicture = "DefaultProfilePicture";
public string ProfilePicture { get; private set; }
public Player()
{
Pseudo = "Player";
ProfilePicture = "DefaultProfilePicture";
}
public Player(string pseudo, string profilePicture = "DefaultProfilePicture")
{
Pseudo = pseudo;
ProfilePicture = profilePicture;
public Player(string pseudo, string profilePicture = "DefaultProfilePicture")
{
Pseudo = pseudo;
ProfilePicture = profilePicture;
}
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