diff --git a/Documentations/Instruction b/Documentations/Instruction
index cf5eaac..8ba492a 100644
--- a/Documentations/Instruction
+++ b/Documentations/Instruction
@@ -1,24 +1,6 @@
-Passer sur git
-
Mono-utilisateur:
- Multilangue
- - Changer les thèmes et les couleurs (en option)
- - jeu classique pas extreme
- - Thème dark
- - Jeu solo complet
- - Push version sur les stores pour la semaine pro
- - Rendre abstract la creation deck V
- - Drag and drop
+ - Changer les thèmes et les couleurs (en option) V => pour l'instant thème blanc et noir
- Option pour mettre/enlever le pas de 10
- - Menu de choix de partie
- - Menu des règles
- - Plus de com (1 mail chaque soir)
- - Faire une classe règle abstraite:
- - Faire une list de règle devant toute être vérifier à chaque carte joué
- - Faire une list de règle devant toute être vérifier à chaque fin de tour
- - Skia
- - GameMaster implémentera un ModeDeJeu qui implémentera des règles du jeu
-
-
- The game -> déposé?
- avant faire fonctionner en local puis on choisira ensemble
\ No newline at end of file
+ - Logo entre les piles (à finir de placer et de redimensionner)
+ - nb carte
\ No newline at end of file
diff --git a/TheGameExtreme.Android/Properties/AndroidManifest.xml b/TheGameExtreme.Android/Properties/AndroidManifest.xml
index 41828fb..f0a1626 100644
--- a/TheGameExtreme.Android/Properties/AndroidManifest.xml
+++ b/TheGameExtreme.Android/Properties/AndroidManifest.xml
@@ -3,13 +3,9 @@
-
-
-
-
-
-
-
+
+
+
\ No newline at end of file
diff --git a/TheGameExtreme.Android/Resources/Resource.designer.cs b/TheGameExtreme.Android/Resources/Resource.designer.cs
index 3e31455..27e2d81 100644
--- a/TheGameExtreme.Android/Resources/Resource.designer.cs
+++ b/TheGameExtreme.Android/Resources/Resource.designer.cs
@@ -1,11 +1,11 @@
#pragma warning disable 1591
//------------------------------------------------------------------------------
//
-// Ce code a été généré par un outil.
-// Version du runtime :4.0.30319.42000
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.42000
//
-// Les modifications apportées à ce fichier peuvent provoquer un comportement incorrect et seront perdues si
-// le code est régénéré.
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
//
//------------------------------------------------------------------------------
diff --git a/TheGameExtreme/Media/TrierImageB.png b/TheGameExtreme/Media/TrierImageB.png
new file mode 100644
index 0000000..3a216ac
Binary files /dev/null and b/TheGameExtreme/Media/TrierImageB.png differ
diff --git a/TheGameExtreme/TheGameExtreme.csproj b/TheGameExtreme/TheGameExtreme.csproj
index 3781ebb..a5ff2d1 100644
--- a/TheGameExtreme/TheGameExtreme.csproj
+++ b/TheGameExtreme/TheGameExtreme.csproj
@@ -44,9 +44,11 @@
+
+
diff --git a/TheGameExtreme/model/Card/cardType/FractionCard.cs b/TheGameExtreme/model/Card/cardType/FractionCard.cs
index 266c700..62b1cc1 100644
--- a/TheGameExtreme/model/Card/cardType/FractionCard.cs
+++ b/TheGameExtreme/model/Card/cardType/FractionCard.cs
@@ -5,11 +5,11 @@ namespace TheGameExtreme.model.card.cardType
{
public static readonly string CARD_FRACTION = "FractionCard";
- private Fraction fraction;
+ public Fraction Fraction { get; set; }
public FractionCard(Fraction value) : base(value.Result())
{
- fraction = value;
+ Fraction = value;
}
public override bool rapidEffect()
@@ -24,7 +24,7 @@ namespace TheGameExtreme.model.card.cardType
public override string ToString()
{
- return fraction.ToString();
+ return Fraction.ToString();
}
}
}
diff --git a/TheGameExtreme/model/Fraction.cs b/TheGameExtreme/model/Fraction.cs
index 6683fe4..f4e0ca4 100644
--- a/TheGameExtreme/model/Fraction.cs
+++ b/TheGameExtreme/model/Fraction.cs
@@ -13,22 +13,18 @@ namespace TheGameExtreme.model
Denominateur = denominateur;
}
- //public int CompareTo(Fraction fraction)
- //{
- // decimal d = (Numerateur / Denominateur) - (fraction.Numerateur / fraction.Denominateur);
- // if (d > 0)
- // {
- // return 1;
- // }
- // else if (d < 0)
- // {
- // return -1;
- // }
- // else
- // {
- // return 0;
- // }
- //}
+ public bool isMultiple(Fraction fraction)
+ {
+ if (Numerateur % fraction.Numerateur == 0)
+ {
+ return true;
+ }
+ if (Denominateur % fraction.Denominateur == 0)
+ {
+ return true;
+ }
+ return false;
+ }
public bool testDiviseurCommun(Fraction fraction)
{
diff --git a/TheGameExtreme/model/gameActions/classic/GameMode.cs b/TheGameExtreme/model/gameActions/classic/GameMode.cs
index 32fea88..f615fb9 100644
--- a/TheGameExtreme/model/gameActions/classic/GameMode.cs
+++ b/TheGameExtreme/model/gameActions/classic/GameMode.cs
@@ -75,23 +75,23 @@ namespace TheGameExtreme.model.gameActions.classic
{
if (start < end)
{
- decimal pivot = ar[end].Value;
+ Card pivot = ar[end];
int pIndex = start;
- decimal swap;
+ Card swap;
for (int i = start; i < end; i++)
{
- if (ar[i].Value < pivot)
+ if (ar[i].Value.CompareTo(pivot.Value) < 0)
{
- swap = ar[pIndex].Value;
- ar[pIndex].Value = ar[i].Value;
- ar[i].Value = swap;
+ swap = ar[pIndex];
+ ar[pIndex] = ar[i];
+ ar[i] = swap;
pIndex++;
}
}
- ar[end].Value = ar[pIndex].Value;
- ar[pIndex].Value = pivot;
+ ar[end] = ar[pIndex];
+ ar[pIndex] = pivot;
quickSort(ar, start, pIndex - 1);
quickSort(ar, pIndex + 1, end);
diff --git a/TheGameExtreme/model/gameActions/classic/JouerUneCarte.cs b/TheGameExtreme/model/gameActions/classic/JouerUneCarte.cs
index 9c8e1e2..9f8c7f3 100644
--- a/TheGameExtreme/model/gameActions/classic/JouerUneCarte.cs
+++ b/TheGameExtreme/model/gameActions/classic/JouerUneCarte.cs
@@ -52,7 +52,7 @@ namespace TheGameExtreme.model.gameActions.classic
protected bool Rule(Card card, Stack stack, bool bottomUp, Player player, List CurrentCardPlayed)
{
- if ((bottomUp && card.Value > stack.Peek().Value) || (!bottomUp && card.Value < stack.Peek().Value) || card.Value.CompareTo(stack.Peek().Value - 10) == 0 || card.Value.CompareTo(stack.Peek().Value + 10) == 0)
+ if ((bottomUp && card.Value.CompareTo(stack.Peek().Value) > 0) || (!bottomUp && card.Value.CompareTo(stack.Peek().Value) < 0)) // || card.Value.CompareTo(stack.Peek().Value - 10) == 0 || card.Value.CompareTo(stack.Peek().Value + 10) == 0 => creer classe abstraite decimal carte qui pour contenir isMultiple
{
OldCard = stack.Peek();
player.joue(card);
diff --git a/TheGameExtreme/view/GamePreparationPage.xaml b/TheGameExtreme/view/GamePreparationPage.xaml
index 33a7fa4..04ae228 100644
--- a/TheGameExtreme/view/GamePreparationPage.xaml
+++ b/TheGameExtreme/view/GamePreparationPage.xaml
@@ -140,22 +140,6 @@
-
-
-
-
-
-
-
+ WidthRequest="200"
+ MaxLength="18"/>
diff --git a/TheGameExtreme/view/GamePreparationPage.xaml.cs b/TheGameExtreme/view/GamePreparationPage.xaml.cs
index 605d4f5..17d8ffa 100644
--- a/TheGameExtreme/view/GamePreparationPage.xaml.cs
+++ b/TheGameExtreme/view/GamePreparationPage.xaml.cs
@@ -85,8 +85,8 @@ namespace TheGameExtreme.view
BackgroundColor = (Color)Application.Current.Resources["SkyBlueColor"],
WidthRequest = 200,
MinimumWidthRequest = 50,
- HorizontalOptions = LayoutOptions.Center
-
+ HorizontalOptions = LayoutOptions.Center,
+ MaxLength = 18
};
diff --git a/TheGameExtreme/view/HomePage.xaml b/TheGameExtreme/view/HomePage.xaml
index 4baa5d0..66da2c4 100644
--- a/TheGameExtreme/view/HomePage.xaml
+++ b/TheGameExtreme/view/HomePage.xaml
@@ -1,70 +1,88 @@
-
+
+
-
-
-
+
+
+
-
-
-
-
+
+
+
+
-
+
-
+
-
+
-
+
-
+
+
+
-
+
diff --git a/TheGameExtreme/view/MainPage.xaml.cs b/TheGameExtreme/view/MainPage.xaml.cs
index d6e852b..ac69a15 100644
--- a/TheGameExtreme/view/MainPage.xaml.cs
+++ b/TheGameExtreme/view/MainPage.xaml.cs
@@ -7,6 +7,8 @@ using SkiaSharp;
using SkiaSharp.Views.Forms;
using TouchTracking;
using Xamarin.Essentials;
+using System.IO;
+using System.Reflection;
namespace TheGameExtreme.view
{
@@ -25,6 +27,8 @@ namespace TheGameExtreme.view
List stackCollection = new List();
Dictionary textDictionary = new Dictionary();
private SKCanvas canvas;
+ private SKBitmap logo;
+ private SKPoint logoPoint;
/**
@@ -53,6 +57,12 @@ namespace TheGameExtreme.view
InflateStack();
InflateHand();
+
+ using (Stream stream = GetType().GetTypeInfo().Assembly.GetManifestResourceStream("TheGameExtreme.Media.TrierImageB.png"))
+ {
+ 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);
}
@@ -97,6 +107,8 @@ namespace TheGameExtreme.view
{
textPaint.Paint(canvas, SKColors.SkyBlue);
}
+
+ canvas.DrawBitmap(logo, logoPoint);
}
diff --git a/TheGameExtreme/view/TouchManipulationCard.cs b/TheGameExtreme/view/TouchManipulationCard.cs
index a696816..f39f23c 100644
--- a/TheGameExtreme/view/TouchManipulationCard.cs
+++ b/TheGameExtreme/view/TouchManipulationCard.cs
@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using SkiaSharp;
+using TheGameExtreme.model.card.cardType;
using TheGameExtreme.viewmodel;
using TouchTracking;
using Xamarin.Essentials;
@@ -14,6 +15,8 @@ namespace TheGameExtreme.view
{
public SKPoint InitialPoint { get; set; }
SKPaint textPaint;
+ SKPaint textPaint1;
+ SKPaint textPaint2;
Dictionary touchDictionary = new Dictionary();
public CardVM Value;
public string display;
@@ -29,6 +32,15 @@ namespace TheGameExtreme.view
{
this.textPaint = textPaint;
Value = value;
+
+ if (Value.View.GetType() == typeof(FractionCard))
+ {
+ textPaint1 = new SKPaint();
+ textPaint2 = new SKPaint();
+ textPaint1.TextSize = textPaint.TextSize;
+ textPaint2.TextSize = textPaint.TextSize;
+ }
+
display = Value.ToString();
height = 2f * width;
@@ -72,11 +84,49 @@ namespace TheGameExtreme.view
textPaint.Style = SKPaintStyle.Stroke;
SKRect card = new SKRect();
- textPaint.MeasureText(display, ref card);
+
+ if (Value.View.GetType() == typeof(FractionCard))
+ {
+ textPaint.MeasureText("00", ref card);
+ textPaint1.Color = color;
+ textPaint1.StrokeWidth = 5;
+ textPaint1.Style = SKPaintStyle.Stroke;
+ textPaint2.Color = color;
+ textPaint2.StrokeWidth = 5;
+ textPaint2.Style = SKPaintStyle.Stroke;
+ }
+ else
+ {
+ textPaint.MeasureText(display, ref card);
+ }
card.Inflate(width, height);
- canvas.DrawRect(card, textPaint);
- canvas.DrawText(display, 0, 0, textPaint);
+ if (Value.View.GetType() == typeof(FractionCard))
+ {
+ canvas.DrawRect(card, textPaint1);
+ if (((FractionCard)Value.View).Fraction.Numerateur < 10 && ((FractionCard)Value.View).Fraction.Numerateur > 0)
+ {
+ canvas.DrawText(((FractionCard)Value.View).Fraction.Numerateur.ToString(), textPaint.MeasureText(((FractionCard)Value.View).Fraction.Numerateur.ToString()) * 0.5f, -50, textPaint);
+ }
+ else
+ {
+ canvas.DrawText(((FractionCard)Value.View).Fraction.Numerateur.ToString(), 0, -50, textPaint);
+ }
+ canvas.DrawText("__", 0, -textPaint.TextSize * 0.5f, textPaint1);
+ if (((FractionCard)Value.View).Fraction.Denominateur < 10 && ((FractionCard)Value.View).Fraction.Denominateur > 0)
+ {
+ canvas.DrawText(((FractionCard)Value.View).Fraction.Denominateur.ToString(), textPaint.MeasureText(((FractionCard)Value.View).Fraction.Denominateur.ToString()) * 0.5f, 50, textPaint2);
+ }
+ else
+ {
+ canvas.DrawText(((FractionCard)Value.View).Fraction.Denominateur.ToString(), 0, 50, textPaint2);
+ }
+ }
+ else
+ {
+ canvas.DrawRect(card, textPaint);
+ canvas.DrawText(display, 0, 0, textPaint);
+ }
canvas.Restore();
@@ -107,7 +157,7 @@ namespace TheGameExtreme.view
SKPoint transformedPoint = inverseMatrix.MapPoint(location);
// Check if it's in the untransformed bitmap rectangle
- SKRect rect = new SKRect(-70, -110, textPaint.MeasureText(display) + 35, textPaint.TextSize);
+ SKRect rect = new SKRect(-width, -height * 1.5f, width * 2.5f + 5, height);
return rect.Contains(transformedPoint);
}
return false;