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:
onyx-and-iris 2026-02-26 00:03:07 +00:00
parent 46a10812b0
commit 72e7728e8f
6 changed files with 13 additions and 9 deletions

View File

@ -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;
} }
} }

View File

@ -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}"

View File

@ -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++)

View File

@ -5,7 +5,7 @@
/// </summary> /// </summary>
enum KindOfLottery : int enum KindOfLottery : int
{ {
Uk, Lotto,
Euro, Euro,
SetForLife, SetForLife,
Thunderball, Thunderball,

View File

@ -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);
} }

View File

@ -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;