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'
Showing
with 171 additions and 190 deletions
......@@ -2,7 +2,8 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:Client"
Startup="App_Startup">
Startup="App_Startup"
StartupUri="MainWindow.xaml">
<Application.Resources>
</Application.Resources>
......
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{12DAE194-2F49-40BC-9E60-D0AB55FFE12B}</ProjectGuid>
<OutputType>Exe</OutputType>
<OutputType>WinExe</OutputType>
<RootNamespace>Client</RootNamespace>
<AssemblyName>Client</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
......@@ -34,13 +34,7 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup>
<StartupObject />
</PropertyGroup>
<ItemGroup>
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
......@@ -69,12 +63,9 @@
<DependentUpon>App.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
<Compile Include="comm\CommClient.cs" />
<Compile Include="data\Class1.cs" />
<Compile Include="data\Data_Client_ctrl.cs" />
<Compile Include="data\DataCore.cs" />
<Compile Include="data\Comm_calls_Data_Client_Impl.cs" />
<Compile Include="data\2.cs" />
<Compile Include="data\IHM_Main_calls_Data_Client_Impl.cs" />
<Compile Include="data\Programtest.cs" />
<Compile Include="ihm-game\Class1.cs" />
......@@ -103,7 +94,6 @@
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
<None Include="bin\Debug\Client.exe.config" />
<None Include="packages.config" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
......@@ -118,7 +108,9 @@
<Name>Shared</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup />
<ItemGroup>
<Folder Include="comm\" />
</ItemGroup>
<ItemGroup>
<Content Include="bin\Debug\Client.exe" />
<Content Include="bin\Debug\Client.pdb" />
......
using System;
namespace Client.Data
{
public class Data_Client
{
private Comm_calls_Data_Client_impl implInterfaceForComm;
public Data_Client()
{
this.implInterfaceForComm = new Comm_calls_Data_Client_impl();
}
public Comm_calls_Data_Client_impl getImplInterfaceForComm()
{
return implInterfaceForComm;
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Client.data
{
class Class1
{
}
}
......@@ -3,21 +3,22 @@ using System;
using System.Collections.Generic;
using System.Data;
namespace Client.Data
{
public class Comm_calls_Data_Client_impl : Shared.interfaces.Interface_Comm_calls_Data_Client
{
private List<LightUser> users = new List<LightUser>();
private List<LightGame> games = new List<LightGame>();
public Comm_calls_Data_Client_impl(){}
public List<LightUser> users { get; set; }
public List<LightGame> games { get; set; }
public Comm_calls_Data_Client_impl(){
this.users = new List<LightUser>();
this.games = new List<LightGame>();
}
public void setGamesAndUsersList(List<LightUser> users, List<LightGame> games)
{
public Comm_calls_Data_Client_impl(List<LightUser> users, List<LightGame> games){
this.users = users;
this.games = games;
}
}
}
......@@ -15,15 +15,13 @@ namespace Client.data
/// Vue principale de l'application.
/// </summary>
private readonly MainWindow mainWindow = new MainWindow();
public DataCore()
{
//Association des vues et de leur view model
Console.WriteLine("hello bor");
Console.WriteLine("Running DataCore class");
}
}
......
......@@ -7,7 +7,6 @@ public class IHM_Main_calls_Data_Client_Impl : Data_Client_ctrl
public IHM_Main_calls_Data_Client_Impl()
{
}
/*
Boolean authenticate(logint string, passwordt string)
......@@ -28,4 +27,4 @@ public class IHM_Main_calls_Data_Client_Impl : Data_Client_ctrl
*/
}
}
charles
boi
\ No newline at end of file
......@@ -33,9 +33,6 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
......@@ -46,9 +43,6 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="comm\CommServer.cs" />
<Compile Include="comm\ClientHandler.cs" />
<Compile Include="data\Class1.cs" />
<Compile Include="data\Comm_calls_Data_Server_Impl.cs" />
<Compile Include="data\Data_Server_ctrl.cs" />
<Compile Include="Program.cs" />
......@@ -56,9 +50,10 @@
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
<None Include="packages.config" />
</ItemGroup>
<ItemGroup />
<ItemGroup>
<Folder Include="comm\" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Shared\Shared.csproj">
<Project>{deedb05f-755c-4573-a317-e84f11529284}</Project>
......
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Server.data
{
class Class1
{
}
}
......@@ -3,45 +3,44 @@ using System;
using System.Collections.Generic;
using System.Data;
namespace Server.Data
{
public class Comm_calls_Data_Server_Impl : Shared.interfaces.Interface_Comm_calls_Data_Server
{
private LightUser user;
private static List<LightUser> users = new List<LightUser>();
private LightUser lightUser;
private static List<LightUser> lightUsers = new List<LightUser>();
private static List<LightGame> games = new List<LightGame>();
public Comm_calls_Data_Server_Impl()
{
this.user = new LightUser();
registerUser(user);
this.lightUser = new LightUser();
this.registerUser(this.lightUser);
}
public LightUser getUser()
{
return this.user;
return this.lightUser;
}
public List<LightUser> registerUser(LightUser user)
public List<LightUser> registerUser(LightUser lightUser)
{
users.Add(user);
return users;
lightUsers.Add(lightUser);
return lightUsers;
}
public void removeUser(int idJoueur)
{
foreach(LightUser user in users)
foreach(LightUser lightUser in lightUsers)
{
if(user.id == idJoueur)
if(lightUser.id == idJoueur)
{
users.Remove(user);
lightUsers.Remove(lightUser);
break;
}
}
}
}
public Comm_calls_Data_Server_Impl getCommCallsDataServerImpl()
{
return this;
......
using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using Server.Data;
public class Class1
namespace Server.Data
{
public Class1()
{
}
}
public class Data_Server_ctrl
{
private Comm_calls_Data_Server_Impl implInterfaceForComm;
public Data_Server_ctrl()
{
implInterfaceForComm = new Comm_calls_Data_Server_Impl();
}
public Comm_calls_Data_Server_Impl getImplInterfaceForComm()
{
return implInterfaceForComm;
}
}
}
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using Server.Data;
namespace Server.Data
{
public class Data_Serveur_ctrl
{
private Comm_calls_Data_Server_Impl implInterfaceForComm;
public Data_Serveur_ctrl()
{
implInterfaceForComm = new Comm_calls_Data_Server_Impl();
}
public Comm_calls_Data_Server_Impl getImplInterfaceForComm()
{
return implInterfaceForComm;
}
}
}
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
......@@ -41,7 +41,6 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<<<<<<< vs/LO23/Shared/Shared.csproj
<Compile Include="data\Game.cs" />
<Compile Include="data\LightGame.cs" />
<Compile Include="data\Round.cs" />
......@@ -55,13 +54,6 @@
<Compile Include="data\User.cs" />
<Compile Include="interfaces\Interface_Comm_calls_Data_Client.cs" />
<Compile Include="interfaces\Interface_Comm_calls_Data_Server.cs" />
<Compile Include="comm\AnnounceUserMessage.cs" />
<Compile Include="comm\UserAnnouncedMessage.cs" />
<Compile Include="comm\MessageToClient.cs" />
<Compile Include="comm\MessageToServer.cs" />
<Compile Include="data\Class1.cs" />
<Compile Include="interfaces\IDataToComm.cs" />
<Compile Include="interfaces\IInterface1.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup />
......
......@@ -4,10 +4,24 @@ namespace Shared.data
{
public class Card
{
private int index;
private char color;
private int value;
private bool isInHand;
private bool isHidden;
public int index { get; set; }
public char color { get; set; }
public int value { get; set; }
public bool isInHand { get; set; }
public bool isHidden { get; set; }
public Card(
int index,
char color,
int value,
bool isInHand,
bool isHidden
) {
this.index = index;
this.color = color;
this.value = value;
this.isInHand = isInHand;
this.isHidden = isHidden;
}
}
}
......@@ -4,18 +4,21 @@ namespace Shared.data
{
public class ChatMessage
{
private DateTime date;
private string sender; // username sera passé en paramètre
private string text;
private int idGame;
/* public Message(DateTime datet, string sendert, string textt, int idGamet)
{
date = datet;
sender = sendert;
text = textt;
idGame = idGamet;
}*/
public DateTime date { get; private set; }
public string sender { get; private set; } // username sera passé en paramètre
public string text { get; private set; }
public int idGame { get; private set; }
public ChatMessage(
DateTime date,
string sender,
string text,
int idGame
) {
this.date = date;
this.sender = sender;
this.text = text;
this.idGame = idGame;
}
}
}
using System;
using System.Collections.Generic;
namespace Shared.data
{
public class Deck
{
private int index;
private Card[] cards;
public int index { get; set; }
public List<Card> cards { get; set; }
public Deck(int index, List<Card> cards)
{
this.index = index;
this.cards = cards;
}
}
}
......@@ -8,18 +8,54 @@ namespace Shared.data
{
public class Game
{
Round[] rounds { get; set; }
int turn { set; get; }
int smallBlind { set; get; }
int bingBLind { set; get; }
int currentPLayerIndex { set; get; }
Phase currentPhase { set; get; }
int pot { set; get; }
int highestBet { set; get; }
int nbNoRise { set; get; }
ChatMessage[] chat { set; get; }
public List<Round> rounds { get; set; }
public int turn { set; get; }
public int smallBlind { set; get; }
public int bingBLind { set; get; }
public int currentPLayerIndex { set; get; }
public Phase currentPhase { set; get; }
public int pot { set; get; }
public int highestBet { set; get; }
public int nbNoRise { set; get; }
public List<ChatMessage> chat { set; get; }
public Game(int smallBlind, int bingBLind)
{
this.rounds = new List<Round>();
this.turn = 0;
this.smallBlind = smallBlind;
this.bingBLind = bingBLind;
this.currentPLayerIndex = 0;
this.currentPhase = new Phase();
this.pot = 0;
this.highestBet = 0;
this.nbNoRise = 0;
this.chat = new List<ChatMessage>();
}
public Game(
List<Round> rounds,
int turn, int smallBlind,
int bingBLind,
int currentPLayerIndex,
Phase currentPhase,
int pot,
int highestBet,
int nbNoRise,
List<ChatMessage> chat
) {
// Not sure if we really need that but it is present in case
// Prefer using the constructor above
this.rounds = rounds;
this.turn = turn;
this.smallBlind = smallBlind;
this.bingBLind = bingBLind;
this.currentPLayerIndex = currentPLayerIndex;
this.currentPhase = currentPhase;
this.pot = pot;
this.highestBet = highestBet;
this.nbNoRise = nbNoRise;
this.chat = chat;
}
}
}
......@@ -6,26 +6,23 @@ using System.Threading.Tasks;
namespace Shared.data
{
enum TypeAction : ushort
public enum TypeAction
{
call = 1,
rise = 2,
allin = 3,
fold = 4
call,
rise,
allin,
fold
}
class GameAction
public class GameAction
{
public int id { get; set; }
public string typeAction { get; set; }
private int id { get; set; }
private TypeAction typeAction { get; set; }
public GameAction(int id, TypeAction typeAction)
public GameAction(int id, string typeAction)
{
this.id = id;
this.typeAction = typeAction;
}
}
......
......@@ -6,31 +6,31 @@ using System.Threading.Tasks;
namespace Shared.data
{
public enum GameStatus : ushort
public enum GameStatus
{
lobby = 0,
running = 1,
paused = 2,
finished = 3
lobby,
running,
paused,
finished,
}
public class LightGame
{
int id { get; set; }
GameStatus status { get; set; }
int indexRound { get; set; }
Player[] players { get; set; }
User[] spectators { get; set; }
User[] lobby { get; set; }
public int id { get; set; }
public string status { get; set; }
public int indexRound { get; set; }
public List<Player> players { get; set; }
public List<User> spectators { get; set; }
public List<User> lobby { get; set; }
public LightGame(int id, GameStatus status, int indexRound, Player[] players, User[] spectators, User[] lobby)
public LightGame(int id)
{
this.id = id;
this.status = status;
this.indexRound = indexRound;
this.players = players;
this.spectators = spectators;
this.lobby = lobby;
this.status = GameStatus.lobby.ToString();
this.indexRound = 0;
this.players = new List<Player>();
this.spectators = new List<User>();
this.lobby = new List<User>();
}
}
}
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