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

Revert "Merge branch 'bourimer/features/v1Beta' into 'ihm-game'"

This reverts commit 1808c9d1, reversing
changes made to 9ba0a419.
parent a6cd358b
No related branches found
No related tags found
4 merge requests!104devV2 comm,!62Feature - Rejoindre Partie,!61Modification de la classe Comm_calls_Data_Server_Impl afin que...,!53feat : Intégration IHM-Main
......@@ -88,8 +88,6 @@
</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" />
......
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Client.ihm_game.DTO
{
class Game
{
}
}
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;
}
}
}
......@@ -21,12 +21,11 @@ namespace Client.ihm_game
private readonly Page gamePage = new GameView();
private readonly GameViewModel gameViewModel;
private readonly GameViewModel gameViewModel = new GameViewModel();
public IhmGameCore()
{
gameViewModel = new GameViewModel(this);
mainWindow.DataContext = mainWindowViewModel;
gamePage.DataContext = gameViewModel;
......
......@@ -6,8 +6,11 @@ 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
......@@ -16,39 +19,9 @@ namespace Client.ihm_game.ViewModels
// 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)
public GameViewModel()
{
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
......@@ -64,25 +37,5 @@ namespace Client.ihm_game.ViewModels
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
}
}
}
......@@ -59,28 +59,28 @@
<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="User 1" 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"/>
<TextBlock Text="solde 1" 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="User 2" 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="User 3" 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="User 4" 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"/>
<TextBlock Text="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>
......
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