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);
|
||||
|
||||
const int newWidth = 600;
|
||||
const int newHeight = 300;
|
||||
const int newHeight = 750;
|
||||
|
||||
window.Width = newWidth;
|
||||
window.Height = newHeight;
|
||||
|
||||
// Optional: Set minimum size to prevent window from being too small
|
||||
window.MinimumWidth = 400;
|
||||
window.MinimumHeight = 600;
|
||||
|
||||
return window;
|
||||
}
|
||||
}
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||
xmlns:local="clr-namespace:Lottery"
|
||||
Shell.FlyoutBehavior="Disabled"
|
||||
Title="Lottery Number Generator">
|
||||
Title="">
|
||||
|
||||
<ShellContent
|
||||
ContentTemplate="{DataTemplate local:MainPage}"
|
||||
|
||||
@ -9,7 +9,7 @@
|
||||
/// <returns>Numbers are returned as a sorted set.</returns>
|
||||
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 = [];
|
||||
|
||||
for (int i = 0; i < limits.Count; i++)
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
/// </summary>
|
||||
enum KindOfLottery : int
|
||||
{
|
||||
Uk,
|
||||
Lotto,
|
||||
Euro,
|
||||
SetForLife,
|
||||
Thunderball,
|
||||
|
||||
@ -13,10 +13,10 @@
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Concrete UKLotto Lottery class.
|
||||
/// Concrete Lotto Lottery class.
|
||||
/// Generates six balls from 1 to 59.
|
||||
/// </summary>
|
||||
internal class UKLottoLottery : Lottery
|
||||
internal class LottoLottery : Lottery
|
||||
{
|
||||
protected override Limits Limits { get; } = new(Count: 6, Lower: 1, Upper: 59);
|
||||
}
|
||||
|
||||
@ -3,19 +3,19 @@
|
||||
public partial class MainPage : ContentPage
|
||||
{
|
||||
readonly List<Lottery> Lotteries = [
|
||||
new UKLottoLottery(),
|
||||
new LottoLottery(),
|
||||
new EuroMillionsLottery(),
|
||||
new SetForLifeLottery(),
|
||||
new ThunderballLottery()
|
||||
];
|
||||
const KindOfLottery DefaultLottery = KindOfLottery.Uk;
|
||||
const KindOfLottery DefaultLottery = KindOfLottery.Lotto;
|
||||
Lottery Lottery;
|
||||
|
||||
public MainPage()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
List<string> lottos = ["UK Lotto", "EuroMillions", "Set For Life", "Thunderball"];
|
||||
List<string> lottos = ["Lotto", "EuroMillions", "Set For Life", "Thunderball"];
|
||||
LotteryPicker.ItemsSource = lottos;
|
||||
LotteryPicker.SelectedIndex = (int)DefaultLottery;
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user