mirror of
https://github.com/onyx-and-iris/Lottery.git
synced 2026-02-26 22:39:10 +00:00
rename UKLotto to Lotto to match the national-lottery website
update the launch size of the app window to match the new layout.
This commit is contained in:
parent
46a10812b0
commit
72e7728e8f
@ -14,11 +14,15 @@
|
|||||||
var window = base.CreateWindow(activationState);
|
var window = base.CreateWindow(activationState);
|
||||||
|
|
||||||
const int newWidth = 600;
|
const int newWidth = 600;
|
||||||
const int newHeight = 300;
|
const int newHeight = 750;
|
||||||
|
|
||||||
window.Width = newWidth;
|
window.Width = newWidth;
|
||||||
window.Height = newHeight;
|
window.Height = newHeight;
|
||||||
|
|
||||||
|
// Optional: Set minimum size to prevent window from being too small
|
||||||
|
window.MinimumWidth = 400;
|
||||||
|
window.MinimumHeight = 600;
|
||||||
|
|
||||||
return window;
|
return window;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||||
xmlns:local="clr-namespace:Lottery"
|
xmlns:local="clr-namespace:Lottery"
|
||||||
Shell.FlyoutBehavior="Disabled"
|
Shell.FlyoutBehavior="Disabled"
|
||||||
Title="Lottery Number Generator">
|
Title="">
|
||||||
|
|
||||||
<ShellContent
|
<ShellContent
|
||||||
ContentTemplate="{DataTemplate local:MainPage}"
|
ContentTemplate="{DataTemplate local:MainPage}"
|
||||||
|
|||||||
@ -9,7 +9,7 @@
|
|||||||
/// <returns>Numbers are returned as a sorted set.</returns>
|
/// <returns>Numbers are returned as a sorted set.</returns>
|
||||||
public static SortedSet<int> Generate(Limits limits)
|
public static SortedSet<int> Generate(Limits limits)
|
||||||
{
|
{
|
||||||
List<int> candidates = Enumerable.Range(limits.Lower, limits.Upper).ToList();
|
List<int> candidates = [.. Enumerable.Range(limits.Lower, limits.Upper)];
|
||||||
SortedSet<int> numbers = [];
|
SortedSet<int> numbers = [];
|
||||||
|
|
||||||
for (int i = 0; i < limits.Count; i++)
|
for (int i = 0; i < limits.Count; i++)
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
enum KindOfLottery : int
|
enum KindOfLottery : int
|
||||||
{
|
{
|
||||||
Uk,
|
Lotto,
|
||||||
Euro,
|
Euro,
|
||||||
SetForLife,
|
SetForLife,
|
||||||
Thunderball,
|
Thunderball,
|
||||||
|
|||||||
@ -13,10 +13,10 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Concrete UKLotto Lottery class.
|
/// Concrete Lotto Lottery class.
|
||||||
/// Generates six balls from 1 to 59.
|
/// Generates six balls from 1 to 59.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
internal class UKLottoLottery : Lottery
|
internal class LottoLottery : Lottery
|
||||||
{
|
{
|
||||||
protected override Limits Limits { get; } = new(Count: 6, Lower: 1, Upper: 59);
|
protected override Limits Limits { get; } = new(Count: 6, Lower: 1, Upper: 59);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,19 +3,19 @@
|
|||||||
public partial class MainPage : ContentPage
|
public partial class MainPage : ContentPage
|
||||||
{
|
{
|
||||||
readonly List<Lottery> Lotteries = [
|
readonly List<Lottery> Lotteries = [
|
||||||
new UKLottoLottery(),
|
new LottoLottery(),
|
||||||
new EuroMillionsLottery(),
|
new EuroMillionsLottery(),
|
||||||
new SetForLifeLottery(),
|
new SetForLifeLottery(),
|
||||||
new ThunderballLottery()
|
new ThunderballLottery()
|
||||||
];
|
];
|
||||||
const KindOfLottery DefaultLottery = KindOfLottery.Uk;
|
const KindOfLottery DefaultLottery = KindOfLottery.Lotto;
|
||||||
Lottery Lottery;
|
Lottery Lottery;
|
||||||
|
|
||||||
public MainPage()
|
public MainPage()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
|
||||||
List<string> lottos = ["UK Lotto", "EuroMillions", "Set For Life", "Thunderball"];
|
List<string> lottos = ["Lotto", "EuroMillions", "Set For Life", "Thunderball"];
|
||||||
LotteryPicker.ItemsSource = lottos;
|
LotteryPicker.ItemsSource = lottos;
|
||||||
LotteryPicker.SelectedIndex = (int)DefaultLottery;
|
LotteryPicker.SelectedIndex = (int)DefaultLottery;
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user