Skip to content
Snippets Groups Projects
Commit 89cab2af authored by Pierre Roussel's avatar Pierre Roussel
Browse files

Merge branch 'data' into 'dev'

Merging 'data' into 'dev'

See merge request !40
parents 9633b782 94eebe9b
No related branches found
No related tags found
6 merge requests!104devV2 comm,!62Feature - Rejoindre Partie,!61Modification de la classe Comm_calls_Data_Server_Impl afin que...,!53feat : Intégration IHM-Main,!52Dev,!40Merging 'data' into 'dev'
......@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Drawing;
namespace Shared.data
{
......@@ -10,20 +11,20 @@ namespace Shared.data
public class LightUser
{
public int id { get; set; }
public string userName;// userName et login c'est la même chose
public string image;
public int id { get; private set; }
public string username { get; set; } // username et login c'est la même chose
public string image { get; set; }
public LightUser(int idt = 1, string userNamet = "usernametest", string imaget = "imagetest")
{
if (idt == 1) { id = idt; }
else
{
// id = Guid.NewGuid(); // ou Guid.NewGuid().ToString()
id = 1;
}
userName = userNamet;
image = imaget;
public LightUser() {}
public LightUser(
int id,
string username,
string image
) {
this.id = id;
this.username = username;
this.image = image;
}
}
}
\ No newline at end of file
......@@ -14,10 +14,14 @@ namespace Shared.data
reveal = 4
}
public class Phase
{
GameAction[] actions { set; get; }
public List<GameAction> actions { set; get; }
public Phase()
{
this.actions = new List<GameAction>();
}
}
}
\ No newline at end of file
using System;
using System.Collections.Generic;
namespace Shared.data
{
enum PlayerRole : ushort
enum PlayerRole
{
smallBlind = 1,
bigBlind = 2,
nothing = 3
smallBlind,
bigBlind,
nothing,
}
public class Player
{
private PlayerRole role;
private bool isFolded;
private int tokens;
private int tokensBet;
private Card[] hand;
public string role { get; set; }
public bool isFolded { get; set; }
public int tokens { get; set; }
public int tokensBet { get; set; }
public List<Card> hand { get; set; }
public Player(int tokens)
{
this.role = PlayerRole.nothing.ToString();
this.isFolded = false;
this.tokens = tokens;
this.tokensBet = 0;
this.hand = new List<Card>();
}
}
}
......@@ -6,13 +6,13 @@ using System.Threading.Tasks;
namespace Shared.data
{
class Round
public class Round
{
Phase[] phases { get; set; }
public List<Phase> phases { get; set; }
public Round(Phase[] phases)
public Round()
{
this.phases = phases;
this.phases = new List<Phase>();
}
}
}
......@@ -8,24 +8,28 @@ namespace Shared.data {
public class User : LightUser
{
public string password;
public bool status;
public string firstname;
public int age;
public User(int idt ,string imaget , string userNamet, string passwordt, bool statust, string firstnamet, int aget)
public string password { get; set; }
public bool status { get; set; }
public string firstname { get; private set; } // Once creted the user should not be able to change his firstname
public string lastname { get; private set; } // Once creted the user should not be able to change his lastname
public int age { get; private set; } // Once creted the user should not be able to change his age
public User(
int id,
string username,
string image,
string password,
bool status,
string firstname,
string lastname,
int age
) : base(id, username, image)
{
id = idt;
image = imaget;
userName = userNamet;
password = passwordt;
status = statust;
firstname = firstnamet;
age = aget;
this.password = password;
this.status = status;
this.firstname = firstname;
this.lastname = lastname;
this.age = age;
}
}
......
......@@ -5,7 +5,7 @@ using System.Text;
using System.Threading.Tasks;
namespace Shared.interfaces
namespace Shared.interfaces
{
public interface Interface_Comm_calls_Data_Client
{
......
......@@ -5,7 +5,7 @@ using System.Text;
using System.Threading.Tasks;
namespace Shared.interfaces
namespace Shared.interfaces
{
public interface Interface_Comm_calls_Data_Server
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment