mirror of
https://github.com/onyx-and-iris/Lottery.git
synced 2026-07-24 21:54:23 +00:00
add powerball lottery
This commit is contained in:
@@ -5,13 +5,11 @@
|
||||
public App()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
MainPage = new AppShell();
|
||||
}
|
||||
|
||||
protected override Window CreateWindow(IActivationState? activationState)
|
||||
{
|
||||
var window = base.CreateWindow(activationState);
|
||||
var window = new Window(new AppShell());
|
||||
|
||||
const int newWidth = 600;
|
||||
const int newHeight = 750;
|
||||
@@ -19,7 +17,6 @@
|
||||
window.Width = newWidth;
|
||||
window.Height = newHeight;
|
||||
|
||||
// Optional: Set minimum size to prevent window from being too small
|
||||
window.MinimumWidth = 400;
|
||||
window.MinimumHeight = 600;
|
||||
|
||||
|
||||
@@ -72,4 +72,15 @@
|
||||
protected override Sample SpecialSample { get; } = new(Lower: 1, Upper: 14, Count: 1);
|
||||
protected override string SpecialIdentifier => "Thunderball";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Concrete class for PowerballLottery lottery.
|
||||
/// Generates five balls from 1 to 69 and one powerball from 1 to 26.
|
||||
/// </summary>
|
||||
internal class PowerballLottery : LotteryWithSpecial
|
||||
{
|
||||
protected override Sample Sample { get; } = new(Lower: 1, Upper: 69, Count: 5);
|
||||
protected override Sample SpecialSample { get; } = new(Lower: 1, Upper: 26, Count: 1);
|
||||
protected override string SpecialIdentifier => "Powerball";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>net8.0-android;net8.0-ios;net8.0-maccatalyst</TargetFrameworks>
|
||||
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net8.0-windows10.0.19041.0</TargetFrameworks>
|
||||
<TargetFrameworks>net9.0-android;net9.0-ios;net8.0-maccatalyst</TargetFrameworks>
|
||||
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net9.0-windows10.0.19041.0</TargetFrameworks>
|
||||
<!-- Uncomment to also build the tizen app. You will need to install tizen by following this: https://github.com/Samsung/Tizen.NET -->
|
||||
<!-- <TargetFrameworks>$(TargetFrameworks);net8.0-tizen</TargetFrameworks> -->
|
||||
|
||||
|
||||
@@ -6,7 +6,8 @@
|
||||
new LottoLottery(),
|
||||
new EuroMillionsLottery(),
|
||||
new SetForLifeLottery(),
|
||||
new ThunderballLottery()
|
||||
new ThunderballLottery(),
|
||||
new PowerballLottery()
|
||||
];
|
||||
const KindOfLottery DefaultLottery = KindOfLottery.Lotto;
|
||||
Lottery Lottery;
|
||||
@@ -15,7 +16,7 @@
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
List<string> lottos = ["Lotto", "EuroMillions", "Set For Life", "Thunderball"];
|
||||
List<string> lottos = ["Lotto", "EuroMillions", "Set For Life", "Thunderball", "Powerball"];
|
||||
LotteryPicker.ItemsSource = lottos;
|
||||
LotteryPicker.SelectedIndex = (int)DefaultLottery;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user