diff --git a/TheGameExtreme/model/deck/CentaineDeck.cs b/TheGameExtreme/model/deck/CentaineDeck.cs index a882921..09a629a 100644 --- a/TheGameExtreme/model/deck/CentaineDeck.cs +++ b/TheGameExtreme/model/deck/CentaineDeck.cs @@ -13,8 +13,8 @@ namespace TheGameExtreme.model.deck int borneMaxRandom = (int)(borneMax * 100); while (deck.Count < nbCard && deck.Count < (borneMaxRandom - borneMinRandom)) { - decimal value = (decimal)(random.Next(borneMinRandom, borneMaxRandom)) / 100; - InsertionDichotomique(deck, 0, deck.Count-1, new ClassicCard(value)); + int value = random.Next(borneMinRandom, borneMaxRandom); + InsertionDichotomique(deck, 0, deck.Count-1, new FractionCard(new Fraction(value, 100))); } } } diff --git a/TheGameExtreme/model/deck/DizaineDeck.cs b/TheGameExtreme/model/deck/DizaineDeck.cs index 0f5dc8e..c7ef670 100644 --- a/TheGameExtreme/model/deck/DizaineDeck.cs +++ b/TheGameExtreme/model/deck/DizaineDeck.cs @@ -12,8 +12,8 @@ namespace TheGameExtreme.model.deck int borneMaxRandom = (int)(borneMax * 10); while (deck.Count < nbCard && deck.Count < (borneMaxRandom - borneMinRandom)) { - decimal value = (decimal)(random.Next(borneMinRandom, borneMaxRandom)) / 10; - InsertionDichotomique(deck, 0, deck.Count-1, new ClassicCard(value)); + int value = random.Next(borneMinRandom, borneMaxRandom); + InsertionDichotomique(deck, 0, deck.Count-1, new FractionCard(new Fraction(value, 10))); } } } diff --git a/TheGameExtreme/model/deck/MilliemeDeck.cs b/TheGameExtreme/model/deck/MilliemeDeck.cs index decdb29..ce60de8 100644 --- a/TheGameExtreme/model/deck/MilliemeDeck.cs +++ b/TheGameExtreme/model/deck/MilliemeDeck.cs @@ -13,8 +13,8 @@ namespace TheGameExtreme.model.deck int borneMaxRandom = (int)(borneMax * 1000); while (deck.Count < nbCard && deck.Count < (borneMaxRandom - borneMinRandom)) { - decimal value = (decimal)(random.Next(borneMinRandom, borneMaxRandom)) / 1000; - InsertionDichotomique(deck, 0, deck.Count-1, new ClassicCard(value)); + int value = random.Next(borneMinRandom, borneMaxRandom); + InsertionDichotomique(deck, 0, deck.Count-1, new FractionCard(new Fraction(value, 1000))); } } } diff --git a/TheGameExtreme/view/MainPage.xaml.cs b/TheGameExtreme/view/MainPage.xaml.cs index b54f826..d194d5b 100644 --- a/TheGameExtreme/view/MainPage.xaml.cs +++ b/TheGameExtreme/view/MainPage.xaml.cs @@ -214,25 +214,24 @@ namespace TheGameExtreme.view textPaint = new SKPaint(); float textWidth; - if (indexMode == 5) + if (indexMode == 2 || indexMode == 5) { textWidth = textPaint.MeasureText("00"); textPaint.TextSize = 0.04f * (float)DeviceDisplay.MainDisplayInfo.Width * textPaint.TextSize / textPaint.MeasureText("00"); } + else if (indexMode == 3) + { + textWidth = textPaint.MeasureText("000"); + textPaint.TextSize = 0.04f * (float)DeviceDisplay.MainDisplayInfo.Width * textPaint.TextSize / textPaint.MeasureText("000"); + } + else if (indexMode == 4) + { + textWidth = textPaint.MeasureText("0000"); + textPaint.TextSize = 0.038f * (float)DeviceDisplay.MainDisplayInfo.Width * textPaint.TextSize / textPaint.MeasureText("0000"); + } else { - if (indexMode == 3) - { - textPaint.TextSize = 0.035f * (float)DeviceDisplay.MainDisplayInfo.Width * textPaint.TextSize / textPaint.MeasureText("00"); - } - else if (indexMode == 4) - { - textPaint.TextSize = 0.025f * (float)DeviceDisplay.MainDisplayInfo.Width * textPaint.TextSize / textPaint.MeasureText("00"); - } - else - { - textPaint.TextSize = 0.04f * (float)DeviceDisplay.MainDisplayInfo.Width * textPaint.TextSize / textPaint.MeasureText("00"); - } + textPaint.TextSize = 0.04f * (float)DeviceDisplay.MainDisplayInfo.Width * textPaint.TextSize / textPaint.MeasureText("00"); textWidth = textPaint.MeasureText(viewmodel.getListOrderedStacks()[i].Peek().Value.ToString()); } position.X -= textWidth * 0.5f; @@ -272,25 +271,24 @@ namespace TheGameExtreme.view textPaint = new SKPaint(); float textWidth; - if (indexMode == 5) + if (indexMode == 2 || indexMode == 5) { textWidth = textPaint.MeasureText("00"); textPaint.TextSize = 0.048f * (float)DeviceDisplay.MainDisplayInfo.Width * textPaint.TextSize / textPaint.MeasureText("00"); } + else if (indexMode == 3) + { + textWidth = textPaint.MeasureText("000"); + textPaint.TextSize = 0.048f * (float)DeviceDisplay.MainDisplayInfo.Width * textPaint.TextSize / textPaint.MeasureText("000"); + } + else if (indexMode == 4) + { + textWidth = textPaint.MeasureText("0000"); + textPaint.TextSize = 0.038f * (float)DeviceDisplay.MainDisplayInfo.Width * textPaint.TextSize / textPaint.MeasureText("0000"); + } else { - if (indexMode == 3) - { - textPaint.TextSize = 0.038f * (float)DeviceDisplay.MainDisplayInfo.Width * textPaint.TextSize / textPaint.MeasureText("00"); - } - else if (indexMode == 4) - { - textPaint.TextSize = 0.028f * (float)DeviceDisplay.MainDisplayInfo.Width * textPaint.TextSize / textPaint.MeasureText("00"); - } - else - { - textPaint.TextSize = 0.048f * (float)DeviceDisplay.MainDisplayInfo.Width * textPaint.TextSize / textPaint.MeasureText("00"); - } + textPaint.TextSize = 0.048f * (float)DeviceDisplay.MainDisplayInfo.Width * textPaint.TextSize / textPaint.MeasureText("00"); textWidth = textPaint.MeasureText(viewmodel.CurrentHand[i].Value.ToString()); } position.X -= textWidth * 0.5f;