Skip to content
Snippets Groups Projects
Commit d1b90ea2 authored by Merwane Bouri's avatar Merwane Bouri
Browse files

Revert "fix: resolve conflict merge dev into ihm-game"

This reverts commit a6cd358b, reversing
changes made to 56638be4.
parent a6cd358b
No related branches found
No related tags found
1 merge request!104devV2 comm
Showing
with 21 additions and 420 deletions
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
</startup>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="CommonServiceLocator" publicKeyToken="489b6accfaf20ef0" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.0.6.0" newVersion="2.0.6.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
\ No newline at end of file
......@@ -7,7 +7,6 @@ using System.Data;
using System.Linq;
using System.Threading.Tasks;
using System.Windows;
using Client.ihm_game;
namespace Client
{
......@@ -16,12 +15,6 @@ namespace Client
/// </summary>
public partial class App : Application
{
private IhmGameCore gameCore;
private void App_Startup(object sender, StartupEventArgs e)
{
gameCore = new IhmGameCore();
}
private DataCore dataCore;
private void App_Startup(object sender, StartupEventArgs e)
......
......@@ -34,28 +34,12 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="CommonServiceLocator, Version=2.0.6.0, Culture=neutral, PublicKeyToken=489b6accfaf20ef0, processorArchitecture=MSIL">
<HintPath>..\packages\CommonServiceLocator.2.0.6\lib\net47\CommonServiceLocator.dll</HintPath>
</Reference>
<Reference Include="GalaSoft.MvvmLight, Version=5.4.1.0, Culture=neutral, PublicKeyToken=e7570ab207bcb616, processorArchitecture=MSIL">
<HintPath>..\packages\MvvmLightLibs.5.4.1.1\lib\net45\GalaSoft.MvvmLight.dll</HintPath>
</Reference>
<Reference Include="GalaSoft.MvvmLight.Extras, Version=5.4.1.0, Culture=neutral, PublicKeyToken=669f0b5e8f868abf, processorArchitecture=MSIL">
<HintPath>..\packages\MvvmLightLibs.5.4.1.1\lib\net45\GalaSoft.MvvmLight.Extras.dll</HintPath>
</Reference>
<Reference Include="GalaSoft.MvvmLight.Platform, Version=5.4.1.0, Culture=neutral, PublicKeyToken=5f873c45e98af8a1, processorArchitecture=MSIL">
<HintPath>..\packages\MvvmLightLibs.5.4.1.1\lib\net45\GalaSoft.MvvmLight.Platform.dll</HintPath>
</Reference>
<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.Windows.Interactivity, Version=4.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\MvvmLightLibs.5.4.1.1\lib\net45\System.Windows.Interactivity.dll</HintPath>
</Reference>
<Reference Include="System.Xml" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Core" />
......@@ -74,32 +58,27 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</ApplicationDefinition>
<Page Include="ihm-game\Views\MainWindow.xaml">
<SubType>Designer</SubType>
<Page Include="MainWindow.xaml">
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="ihm-game\Views\Pages\GameView.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Compile Include="App.xaml.cs">
<DependentUpon>App.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
<Compile Include="comm\Class1.cs" />
<Compile Include="data\Class1.cs" />
<Compile Include="ihm-game\DTO\Game.cs" />
<Compile Include="ihm-game\DTO\LightGame.cs" />
<Compile Include="ihm-game\IhmGameCore.cs" />
<Compile Include="ihm-game\ViewModels\GameViewModel.cs" />
<Compile Include="ihm-game\ViewModels\MainWindowViewModel.cs" />
<Compile Include="ihm-game\Views\MainWindow.xaml.cs">
<Compile Include="comm\CommClient.cs" />
<Compile Include="comm\IDataToCommImpl.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\IHM_Main_calls_Data_Client_Impl.cs" />
<Compile Include="data\Programtest.cs" />
<Compile Include="ihm-game\Class1.cs" />
<Compile Include="ihm-main\Class1.cs" />
<Compile Include="MainWindow.xaml.cs">
<DependentUpon>MainWindow.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
<Compile Include="ihm-game\Views\Pages\GameView.xaml.cs">
<DependentUpon>GameView.xaml</DependentUpon>
</Compile>
<Compile Include="ihm-main\Class1.cs" />
</ItemGroup>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs">
......@@ -129,19 +108,6 @@
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
<Resource Include="ihm-game\Views\images\config.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Resource>
<Resource Include="ihm-game\Views\images\coucher.png" />
<Resource Include="ihm-game\Views\images\doubler.png" />
<Resource Include="ihm-game\Views\images\egaler.png" />
<Resource Include="ihm-game\Views\images\main_recto.png" />
<Resource Include="ihm-game\Views\images\main_verso.png" />
<Resource Include="ihm-game\Views\images\mise.png" />
<Resource Include="ihm-game\Views\images\pot.png" />
<Resource Include="ihm-game\Views\images\utilisateur.png" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Shared\Shared.csproj">
<Project>{deedb05f-755c-4573-a317-e84f11529284}</Project>
......@@ -155,8 +121,5 @@
<Content Include="bin\Debug\Shared.dll" />
<Content Include="bin\Debug\Shared.pdb" />
</ItemGroup>
<ItemGroup>
<Resource Include="ihm-game\Views\images\Enchere.png" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
\ No newline at end of file
<Window x:Class="Client.ihm_game.Views.MainWindow"
<Window x:Class="Client.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:Client.ihm_game.Views"
xmlns:local="clr-namespace:Client"
mc:Ignorable="d"
Title="MainWindow" Height="450" Width="800">
<Frame Content="{Binding Path=ActivePage}"/> <!-- important pour afficher la page courante active-->
<Grid>
</Grid>
</Window>
......@@ -13,7 +13,7 @@ using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace Client.ihm_game.Views
namespace Client
{
/// <summary>
/// Logique d'interaction pour MainWindow.xaml
......
......@@ -4,9 +4,9 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Client.ihm_game.DTO
namespace Client.ihm_game
{
class Game
class Class1
{
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
// Classes temporaires à remplacer par les classes de DATA
namespace Client.ihm_game.DTO
{
public class Card
{
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;
}
}
enum PlayerRole
{
smallBlind,
bigBlind,
nothing,
}
class Player
{
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 string username { get; set; }
public string image { get; set; }
public Player(int tokens,string username, string image)
{
this.role = PlayerRole.nothing.ToString();
this.isFolded = false;
this.tokens = tokens;
this.tokensBet = 0;
this.hand = new List<Card>();
this.username = username;
this.image = image;
}
}
internal class LightGame
{
public int id { get; set; }
public int indexRound { get; set; }
public List<Player> players { get; set; }
public int pot { set; get; }
public LightGame(int id, List<Player> players, int pot)
{
this.id = id;
this.indexRound = 0;
this.players = players;
this.pot = pot;
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Client.ihm_game.ViewModels;
using Client.ihm_game.Views;
using Client.ihm_game.Views.Pages;
using System.Windows;
using System.Windows.Controls;
namespace Client.ihm_game
{
internal class IhmGameCore
{
private readonly MainWindow mainWindow = new MainWindow();
private readonly MainWindowViewModel mainWindowViewModel = new MainWindowViewModel();
private readonly Page gamePage = new GameView();
private readonly GameViewModel gameViewModel;
public IhmGameCore()
{
gameViewModel = new GameViewModel(this);
mainWindow.DataContext = mainWindowViewModel;
gamePage.DataContext = gameViewModel;
mainWindowViewModel.ActivePage = gamePage;
mainWindow.Show();
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Input;
using GalaSoft.MvvmLight.CommandWpf;
using Client.ihm_game.DTO;
using System.Collections.ObjectModel;
namespace Client.ihm_game.ViewModels
{
internal class GameViewModel
{
// pour ajouter un bouton, dans le xaml section bouton-> Command="{Binding Path=ParamCommand}"
// exemple: <Button Name="BT_parameter" Grid.Row="0" Grid.Column="0" BorderThickness="0" Background="#a2aebb" Command="{Binding Path=ParamCommand}">
public ICommand ParamCommand { get; set; }
public ICommand FoldCommand { get; set; }
public ICommand CallCommand { get; set; }
public ICommand RaiseCommand { get; set; }
public LightGame lightgame { get; set; }
private readonly IhmGameCore core;
private List<Player> players;
public GameViewModel(IhmGameCore core)
{
ParamCommand = new RelayCommand(OnParamClick);
FoldCommand = new RelayCommand(OnFoldClick);
CallCommand = new RelayCommand(OnCallClick);
RaiseCommand = new RelayCommand(OnRaiseClick);
players = new List<Player>
{
new Player(20,"joueur1","joueur1.png"),
new Player(30,"joueur2", "joueur2.png"),
new Player(30,"joueur3", "joueur3.png"),
new Player(30,"joueur4","joueur4.png")
};
lightgame = new LightGame(3, players, 200);
this.core = core;
Display();
}
// fonction lié au bouton
// mécanisme temporaire juste pour tester affichage d'une console de message
private void OnParamClick()
{
// exemple de fenêtre warning
/* MessageBoxResult result = MessageBox.Show("message dans la fenêtre","nom de la fenêtre", MessageBoxButton.OKCancel, MessageBoxImage.Warning);
if(result == MessageBoxResult.OK)
{
} */
MessageBox.Show("message dans la fenêtre", "nom de la fenêtre", MessageBoxButton.OK, MessageBoxImage.Information, MessageBoxResult.OK);
}
private void OnFoldClick()
{
MessageBox.Show("bouton fold", "bouton fold", MessageBoxButton.OK, MessageBoxImage.Information, MessageBoxResult.OK);
}
private void OnCallClick()
{
MessageBox.Show("bouton call", "bouton call", MessageBoxButton.OK, MessageBoxImage.Information, MessageBoxResult.OK);
}
private void OnRaiseClick()
{
MessageBox.Show("bouton raise", "bouton raise", MessageBoxButton.OK, MessageBoxImage.Information, MessageBoxResult.OK);
}
private void Display()
{
//Fonctions à remplacer par les fonctions qui seront implémenter dans IHMGameCallsData
}
}
}

using System.Windows.Controls;
namespace Client.ihm_game.ViewModels
{
internal class MainWindowViewModel
{
private Page activePage;
public Page ActivePage
{
get => activePage;
set
{
activePage = value;
}
}
public MainWindowViewModel()
{
}
}
}
<Page x:Class="Client.ihm_game.Views.Pages.GameView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Client.ihm_game.Views.Pages"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800"
Title="GameView">
<Grid Background="#a2aebb">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.5*"/>
<ColumnDefinition />
<ColumnDefinition />
<ColumnDefinition />
<ColumnDefinition />
<ColumnDefinition />
<ColumnDefinition />
<ColumnDefinition />
<ColumnDefinition />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="0.5*"/>
<RowDefinition />
<RowDefinition />
<RowDefinition />
<RowDefinition />
<RowDefinition />
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<Button Name="BT_parameter" Grid.Row="0" Grid.Column="0" BorderThickness="0" Background="#a2aebb" Command="{Binding Path=ParamCommand}">
<Image Source="/Client;component/ihm-game/Views/images/config.png"/>
</Button>
<Image Source="/Client;component/ihm-game/Views/images/main_verso.png" Grid.Column="2" Grid.Row="3"/>
<Image Source="/Client;component/ihm-game/Views/images/main_verso.png" Grid.Column="5" Grid.Row="1"/>
<Image Source="/Client;component/ihm-game/Views/images/main_verso.png" Grid.Column="8" Grid.Row="3"/>
<Button Name="BT_seCoucher" Grid.Column="1" Grid.Row="7" BorderThickness="0" Background="#a2aebb" Command="{Binding Path=FoldCommand}">
<Image Source="/Client;component/ihm-game/Views/images/coucher.png"/>
</Button>
<Button Name="BT_egaler" Grid.Column="4" Grid.Row="7" BorderThickness="0" Background="#a2aebb" Command="{Binding Path=CallCommand}">
<Image Source="/Client;component/ihm-game/Views/images/egaler.png"/>
</Button>
<Button Name="BT_doubler" Grid.Column="7" Grid.Row="7" BorderThickness="0" Background="#a2aebb" Command="{Binding Path=RaiseCommand}">
<Image Source="/Client;component/ihm-game/Views/images/doubler.png"/>
</Button>
<Viewbox Grid.Column="4" Grid.Row="7" StretchDirection="DownOnly">
<TextBlock Text="20" Name="TBlock_call" Background="Transparent" MaxHeight="50" MaxWidth="50"/>
</Viewbox>
<!-- Pour relier le contenu du texte au code, mettre le champs Text="{Binding <Game.callValue>}" puis dans le code relier avec un setter-->
<TextBlock Text="test" Grid.Column="7" Grid.Row="7" Name="TB_raise" Background="Transparent" TextWrapping="Wrap" HorizontalAlignment="Center" VerticalAlignment="Center"/>
<TextBlock Text="{Binding lightgame.players[0].username}" Name="TBlock_user1" Grid.Column="1" Grid.Row="3" FontSize="14" HorizontalAlignment="Center" VerticalAlignment="Center"/>
<TextBlock Text="Mise 1" Name="TBlock_bet1" Grid.Column="3" Grid.Row="3" FontSize="14" HorizontalAlignment="Center" VerticalAlignment="Center"/>
<TextBlock Text="{Binding lightgame.players[0].tokens}" Name="TBlock_balance1" Grid.Column="1" Grid.Row="4" FontSize="14" HorizontalAlignment="Center" VerticalAlignment="Center"/>
<Image Source="/Client;component/ihm-game/Views/images/enchere.png" Grid.Column="3" Grid.Row="3" Height="30" Margin="2.667,37,56.333,2" />
<TextBlock Text="{Binding lightgame.players[1].username}" Name="TBlock_user2" Grid.Column="4" Grid.Row="5" FontSize="14" HorizontalAlignment="Center" VerticalAlignment="Center"/>
<TextBlock Text="Cards 2" Grid.Column="5" Grid.Row="5" FontSize="14" HorizontalAlignment="Center" VerticalAlignment="Center"/>
<TextBlock Text="Mise 2" Name="TBlock_bet2" Grid.Column="4" Grid.Row="4" FontSize="14" HorizontalAlignment="Center" VerticalAlignment="Center"/>
<Image Source="/Client;component/ihm-game/Views/images/enchere.png" Grid.Column="4" Grid.Row="4" Height="30" Margin="2.667,37,56.333,2"/>
<TextBlock Text="solde 2" Name="TBlock_balance2" Grid.Column="4" Grid.Row="6" FontSize="14" HorizontalAlignment="Center" VerticalAlignment="Center"/>
<TextBlock Text="{Binding lightgame.players[2].username}" Name="TBlock_user3" Grid.Column="4" Grid.Row="1" FontSize="14" HorizontalAlignment="Center" VerticalAlignment="Center"/>
<TextBlock Text="Mise 3" Name="TBlock_bet3" Grid.Column="4" Grid.Row="2" FontSize="14" HorizontalAlignment="Center" VerticalAlignment="Center"/>
<Image Source="/Client;component/ihm-game/Views/images/enchere.png" Grid.Column="4" Grid.Row="2" Height="30" Margin="2.667,37,56.333,2"/>
<TextBlock Text="solde 3" Name="TBlock_balance3" Grid.Column="3" Grid.Row="1" FontSize="14" HorizontalAlignment="Center" VerticalAlignment="Center"/>
<TextBlock Text="Mise 4" Name="TBlock_bet4" Grid.Column="7" Grid.Row="3" FontSize="14" HorizontalAlignment="Center" VerticalAlignment="Center"/>
<Image Source="/Client;component/ihm-game/Views/images/enchere.png" Grid.Column="7" Grid.Row="3" Height="30" Margin="2.667,37,56.333,2"/>
<TextBlock Text="{Binding lightgame.players[3].username}" Name="TBlock_user4" Grid.Column="9" Grid.Row="3" FontSize="14" HorizontalAlignment="Center" VerticalAlignment="Center"/>
<TextBlock Text="solde 4" Name="TBlock_balance4" Grid.Column="9" Grid.Row="4" FontSize="14" HorizontalAlignment="Center" VerticalAlignment="Center"/>
<TextBlock Text="{Binding lightgame.pot}" Name="TBlock_pot" Grid.Column="5" Grid.Row="3" FontSize="14" HorizontalAlignment="Center" VerticalAlignment="Center"/>
<Image Source="/Client;component/ihm-game/Views/images/pot.png" Grid.Column="5" Grid.Row="3" Margin="8.667,0,19.333,10"/>
</Grid>
</Page>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace Client.ihm_game.Views.Pages
{
/// <summary>
/// Logique d'interaction pour GameView.xaml
/// </summary>
public partial class GameView : Page
{
public GameView()
{
InitializeComponent();
}
}
}
vs/LO23/Client/ihm-game/Views/images/Enchere.png

1.26 KiB

vs/LO23/Client/ihm-game/Views/images/config.png

1.73 KiB

vs/LO23/Client/ihm-game/Views/images/coucher.png

3.23 KiB

vs/LO23/Client/ihm-game/Views/images/doubler.png

2.25 KiB

vs/LO23/Client/ihm-game/Views/images/egaler.png

2.14 KiB

vs/LO23/Client/ihm-game/Views/images/main_recto.png

15 KiB

vs/LO23/Client/ihm-game/Views/images/main_verso.png

21.9 KiB

vs/LO23/Client/ihm-game/Views/images/mise.png

145 KiB

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