@ -22,6 +22,7 @@ namespace TheGameExtreme.view
private Main viewmodel ;
private Main viewmodel ;
private List < string > playersNames ;
private List < string > playersNames ;
private int nbPile ;
private int nbPile ;
private int nbCard ;
private int indexMode ;
private int indexMode ;
List < TouchManipulationCard > textCollection = new List < TouchManipulationCard > ( ) ;
List < TouchManipulationCard > textCollection = new List < TouchManipulationCard > ( ) ;
List < TouchManipulationCard > stackCollection = new List < TouchManipulationCard > ( ) ;
List < TouchManipulationCard > stackCollection = new List < TouchManipulationCard > ( ) ;
@ -36,10 +37,11 @@ namespace TheGameExtreme.view
* < param name = "nbPile" > Nombre de piles pour jouer < / param >
* < param name = "nbPile" > Nombre de piles pour jouer < / param >
* < param name = "indexMode" > Version du jeu jou é < / param >
* < param name = "indexMode" > Version du jeu jou é < / param >
* /
* /
public MainPage ( List < string > playersNames , int nbPile , int indexMode )
public MainPage ( List < string > playersNames , int nbPile , int indexMode , int nbCard )
{
{
this . playersNames = playersNames ;
this . playersNames = playersNames ;
this . nbPile = nbPile ;
this . nbPile = nbPile ;
this . nbCard = nbCard ;
this . indexMode = indexMode ;
this . indexMode = indexMode ;
InitializeComponent ( ) ;
InitializeComponent ( ) ;
@ -47,7 +49,7 @@ namespace TheGameExtreme.view
EndTurnButton . Text = AppRessource . StrEndTurn ; // Trouver le moyen d'avoir du binding
EndTurnButton . Text = AppRessource . StrEndTurn ; // Trouver le moyen d'avoir du binding
viewmodel = new Main ( playersNames , nbPile , indexMode) ;
viewmodel = new Main ( playersNames , nbPile , nbCard, indexMode) ;
viewmodel . EndGame + = OnEndGame ;
viewmodel . EndGame + = OnEndGame ;
@ -58,11 +60,21 @@ namespace TheGameExtreme.view
InflateStack ( ) ;
InflateStack ( ) ;
InflateHand ( ) ;
InflateHand ( ) ;
using ( Stream stream = GetType ( ) . GetTypeInfo ( ) . Assembly . GetManifestResourceStream ( "TheGameExtreme.Media.TrierImageB.png" ) )
string ressourceID ;
if ( DeviceDisplay . MainDisplayInfo . Height > 1500 )
{
ressourceID = "TheGameExtreme.Media.TrierImageBMax.png" ;
}
else
{
ressourceID = "TheGameExtreme.Media.TrierImageBMin.png" ;
}
using ( Stream stream = GetType ( ) . GetTypeInfo ( ) . Assembly . GetManifestResourceStream ( ressourceID ) )
{
{
logo = SKBitmap . Decode ( stream ) ;
logo = SKBitmap . Decode ( stream ) ;
}
}
logoPoint = new SKPoint ( ( float ) DeviceDisplay . MainDisplayInfo . Width * 0.5f - logo . Width * 0.5f , ( float ) ( DeviceDisplay . MainDisplayInfo . Height * 0.9 ) * 0.5f - logo . Height * 0.5f ) ;
logoPoint = new SKPoint ( ( float ) DeviceDisplay . MainDisplayInfo . Width * 0.5f - logo . Width , ( float ) ( DeviceDisplay . MainDisplayInfo . Height * 0.9 ) * 0.5f - logo . Height * 0.5f ) ;
}
}
@ -291,7 +303,7 @@ namespace TheGameExtreme.view
* /
* /
private void Retry ( object sender , EventArgs args )
private void Retry ( object sender , EventArgs args )
{
{
viewmodel = new Main ( playersNames , nbPile , indexMode) ;
viewmodel = new Main ( playersNames , nbPile , nbCard, indexMode) ;
viewmodel . EndGame + = OnEndGame ;
viewmodel . EndGame + = OnEndGame ;