Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
M1888
lottokone
Commits
79d4500a
Commit
79d4500a
authored
Apr 18, 2019
by
M1888
Browse files
aamukoodailut
parent
794e6fb4
Changes
12
Hide whitespace changes
Inline
Side-by-side
Lottokone/Asetukset.xaml
View file @
79d4500a
...
...
@@ -14,7 +14,7 @@
<StackPanel>
<DockPanel Margin="5">
<Label>Pelaajia</Label>
<TextBox Style="{StaticResource Asetusboksi}" x:Name="txbPelaajia" Text="{Binding Pelaajia, Mode=TwoWay}" />
<TextBox Style="{StaticResource Asetusboksi}" x:Name="txbPelaajia" Text="{Binding Pelaajia, Mode=TwoWay}"
TextChanged="txbChanged"
/>
</DockPanel>
<TextBlock Margin="25,-5,0,0">Simulaatiossa käytettävien pelaajien määrä.</TextBlock>
</StackPanel>
...
...
@@ -22,7 +22,7 @@
<StackPanel>
<DockPanel Margin="5">
<Label>Rivejä</Label>
<TextBox Style="{StaticResource Asetusboksi}" x:Name="txbRiveja" Text="{Binding Riveja, Mode=TwoWay}" />
<TextBox Style="{StaticResource Asetusboksi}" x:Name="txbRiveja" Text="{Binding Riveja, Mode=TwoWay}"
TextChanged="txbChanged"
/>
</DockPanel>
<TextBlock Margin="25,-5,0,0">Simuloitujen pelaajien rivien määrä per pelaaja.</TextBlock>
</StackPanel>
...
...
@@ -30,7 +30,7 @@
<StackPanel>
<DockPanel Margin="5">
<Label>Rivit voimassa</Label>
<TextBox Style="{StaticResource Asetusboksi}" x:Name="txbVoimassa" Text="{Binding Voimassa, Mode=TwoWay}" />
<TextBox Style="{StaticResource Asetusboksi}" x:Name="txbVoimassa" Text="{Binding Voimassa, Mode=TwoWay}"
TextChanged="txbChanged"
/>
</DockPanel>
<TextBlock Margin="25,-5,0,0">Kuinka monta kierrosta simuloitujen pelaajien rivit pysyvät voimassa, kunnes ne arvotaan uudelleen.</TextBlock>
</StackPanel>
...
...
@@ -57,7 +57,7 @@
<StackPanel>
<DockPanel Margin="5">
<Label>Arparivejä</Label>
<TextBox Style="{StaticResource Asetusboksi}" x:Name="txbArparivit" Text="{Binding Arparivit, Mode=TwoWay}" />
<TextBox Style="{StaticResource Asetusboksi}" x:Name="txbArparivit" Text="{Binding Arparivit, Mode=TwoWay}"
TextChanged="txbChanged"
/>
</DockPanel>
<TextBlock Margin="25,-5,0,0">Kuinka monta satunnaisesti arvottua riviä haluat pitää</TextBlock>
</StackPanel>
...
...
@@ -65,7 +65,7 @@
<StackPanel>
<DockPanel Margin="5">
<Label>Arparivit voimassa</Label>
<TextBox Style="{StaticResource Asetusboksi}" x:Name="txbArparivitVoimassa" Text="{Binding ArparivitVoimassa, Mode=TwoWay}" />
<TextBox Style="{StaticResource Asetusboksi}" x:Name="txbArparivitVoimassa" Text="{Binding ArparivitVoimassa, Mode=TwoWay}"
TextChanged="txbChanged"
/>
</DockPanel>
<TextBlock Margin="25,-5,0,0">Kuinka monen kierroksen välein rivisi arvotaan uudelleen?</TextBlock>
</StackPanel>
...
...
@@ -73,7 +73,7 @@
<StackPanel>
<DockPanel Margin="5">
<Label>Vakiorivejä</Label>
<TextBox Style="{StaticResource Asetusboksi}" x:Name="txbVakiorivit" Text="{Binding Vakiorivit, Mode=TwoWay}" />
<TextBox Style="{StaticResource Asetusboksi}" x:Name="txbVakiorivit" Text="{Binding Vakiorivit, Mode=TwoWay}"
TextChanged="txbChanged"
/>
</DockPanel>
<TextBlock Margin="25,-5,0,0">Montako vakioriviä haluat pelata?</TextBlock>
<Button Content="Aseta rivit" Width="100" x:Name="btnRivit" Click="BtnRivit_Click" />
...
...
@@ -83,6 +83,7 @@
</StackPanel>
<Button x:Name="btnSave" Content="Tallenna & sulje" Click="btnSave_Click" Margin="15" />
<Label x:Name="lblInfo" Foreground="Red" />
</StackPanel>
</Grid>
</Window>
Lottokone/Asetukset.xaml.cs
View file @
79d4500a
...
...
@@ -37,5 +37,27 @@ namespace Lottokone
var
ikkuna
=
new
Lottorivit
();
ikkuna
.
ShowDialog
();
}
public
void
txbChanged
(
object
sender
,
TextChangedEventArgs
e
)
{
TextBox
tb
=
sender
as
TextBox
;
if
(
tb
!=
null
)
{
bool
ok
=
false
;
if
(
int
.
TryParse
(
tb
.
Text
,
out
int
result
))
if
(
result
>=
0
&&
result
<
6
_000_000
)
ok
=
true
;
if
(!
ok
)
{
lblInfo
.
Content
=
"Asetathan luvuille tarkoitettuihin laatikoihin vain numeroita."
;
btnSave
.
IsEnabled
=
false
;
}
else
{
lblInfo
.
Content
=
""
;
btnSave
.
IsEnabled
=
true
;
}
}
}
}
}
Lottokone/Lottokone.csproj
View file @
79d4500a
...
...
@@ -148,6 +148,12 @@
<ItemGroup>
<Resource
Include=
"Resources\lottovoittaja.png"
/>
</ItemGroup>
<ItemGroup>
<Resource
Include=
"Resources\lotto0.png"
/>
<Resource
Include=
"Resources\lotto1.png"
/>
<Resource
Include=
"Resources\lotto2.png"
/>
<Resource
Include=
"Resources\lotto3.png"
/>
</ItemGroup>
<Import
Project=
"$(MSBuildToolsPath)\Microsoft.CSharp.targets"
/>
<Import
Project=
"packages\System.Data.SQLite.Core.1.0.110.0\build\net46\System.Data.SQLite.Core.targets"
Condition=
"Exists('packages\System.Data.SQLite.Core.1.0.110.0\build\net46\System.Data.SQLite.Core.targets')"
/>
<Target
Name=
"EnsureNuGetPackageBuildImports"
BeforeTargets=
"PrepareForBuild"
>
...
...
Lottokone/MainWindow.xaml
View file @
79d4500a
...
...
@@ -5,41 +5,40 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:Lottokone"
mc:Ignorable="d"
Title="Lottokone" Height="450" Width="950">
<Window.Background>
<ImageBrush ImageSource="Resources/lotto.png" />
</Window.Background>
<StackPanel Orientation="Horizontal">
<StackPanel Margin="0,10,0,0">
<Button x:Name="btnNext" Margin="0,5,0,0" Content="Seuraava viikko" Click="btnNext_Click"/>
<Button x:Name="btnStart" Margin="0,5,0,0" Content="Käynnistä" Click="btnStart_Click"/>
<Button x:Name="btnStop" Margin="0,5,0,0" Content="Pysäytä" Click="btnStop_Click"/>
<Button x:Name="btnSettings" Margin="0,50,0,0" Content="Asetukset" Click="btnSettings_Click" />
</StackPanel>
Title="Lottokone" Height="450" Width="950" Background="Black">
<StackPanel Orientation="Horizontal">
<StackPanel Margin="0,10,0,0">
<Button x:Name="btnNext" Margin="0,5,0,0" Content="Seuraava viikko" Click="btnNext_Click"/>
<Button x:Name="btnStart" Margin="0,5,0,0" Content="Käynnistä" Click="btnStart_Click"/>
<Button x:Name="btnStop" Margin="0,5,0,0" Content="Pysäytä" Click="btnStop_Click"/>
<Button x:Name="btnSettings" Margin="0,50,0,0" Content="Asetukset" Click="btnSettings_Click" />
</StackPanel>
<StackPanel Height="400">
<StackPanel x:Name="spLotto" Width="250" Background="White" Opacity="0.6" VerticalAlignment="Top">
<Label Style="{StaticResource Isompi}" Content="{Binding Vuosi}" ContentStringFormat="Vuosi: {0}"/>
<Label Style="{StaticResource Isompi}" Content="{Binding Viikko}" ContentStringFormat="Viikko: {0}"/>
<Label Style="{StaticResource Isompi}" Content="{Binding Rivimaara}" ContentStringFormat="Rivejä: {0:N0}"/>
<Label Style="{StaticResource Isompi}" Content="{Binding Potti}" ContentStringFormat="Potti: {0:C0}"/>
<Label Style="{StaticResource Isompi}" Content="{Binding Paavoitto}" ContentStringFormat="Päävoitto: {0:C0}"/>
<Label Style="{StaticResource Isompi}" Content="{Binding Voitot[0]}" ContentStringFormat="Päävoitto: {0:C0}"/>
<Label Style="{StaticResource Isompi}">Voittorivi:</Label>
<Label Style="{StaticResource Isompi}" Content="{Binding Voittorivi}" />
</StackPanel>
<StackPanel>
<Label Style="{StaticResource Isompi}" Content="Status:"/>
<ListView Height="350" Width="300" x:Name="lstStatus" ItemsSource="{Binding Value, UpdateSourceTrigger=PropertyChanged}" Opacity="0.7"/>
<Image x:Name="imgLotto" Width="250" Height="300" HorizontalAlignment="Left" VerticalAlignment="Bottom" Source="Resources/lotto0.png"/>
</StackPanel>
<StackPanel>
<Label Style="{StaticResource Isompi}" Foreground="White" Content="Status:"/>
<ListView Height="350" Width="300" x:Name="lstStatus" ItemsSource="{Binding Value, UpdateSourceTrigger=PropertyChanged}" Opacity="0.7"/>
</StackPanel>
<StackPanel>
<StackPanel x:Name="spPlayer" Width="300" Margin="5,0,0,0" Background="White" Opacity="0.8">
<Label Style="{StaticResource Isompi}" Content="{Binding Nimi}" ContentStringFormat="Nimi: {0}" />
<Label Style="{StaticResource Isompi}" Content="{Binding Saldo}" ContentStringFormat="Tilin saldo: {0:C0}" />
<Label Style="{StaticResource Isompi}" Content="{Binding Riveja}" ContentStringFormat="Rivejä: {0:N0}" />
</StackPanel>
<StackPanel>
<StackPanel x:Name="spPlayer" Width="300" Margin="5,0,0,0" Background="White" Opacity="0.8">
<Label Style="{StaticResource Isompi}" Content="{Binding Nimi}" ContentStringFormat="Nimi: {0}" />
<Label Style="{StaticResource Isompi}" Content="{Binding Saldo}" ContentStringFormat="Tilin saldo: {0:C0}" />
<Label Style="{StaticResource Isompi}" Content="{Binding Riveja}" ContentStringFormat="Rivejä: {0:N0}" />
</StackPanel>
<StackPanel Width="300">
<Label Style="{StaticResource Isompi}" Content="Omat voitot:" Margin="0,100,0,0"/>
<ListView x:Name="lstVoitot" Height="180" Width="300" Opacity="0.7">
</ListView>
</StackPanel>
<StackPanel Width="300">
<Label Style="{StaticResource Isompi}" Foreground="White" Content="Omat voitot:" Margin="0,100,0,0"/>
<ListView x:Name="lstVoitot" Height="180" Width="300" Opacity="0.7">
</ListView>
</StackPanel>
</StackPanel>
</StackPanel>
</Window>
Lottokone/MainWindow.xaml.cs
View file @
79d4500a
...
...
@@ -57,26 +57,32 @@ namespace Lottokone
case
3
:
if
(
r
.
Numerot
.
Contains
(
kone
.
Voittorivi
.
Lisanumero
))
{
s
=
$"Kierros
{
kone
.
Kierros
}
: 3+1 oikein"
;
s
=
$"Kierros
{
kone
.
Kierros
}
: 3+1 oikein (
{
kone
.
Voitot
[
5
]:
C0
}
)"
;
}
break
;
case
4
:
s
=
$"Kierros
{
kone
.
Kierros
}
: 4 oikein"
;
s
=
$"Kierros
{
kone
.
Kierros
}
: 4 oikein
(
{
kone
.
Voitot
[
4
]:
C0
}
)
"
;
break
;
case
5
:
s
=
$"Kierros
{
kone
.
Kierros
}
: 5 oikein"
;
s
=
$"Kierros
{
kone
.
Kierros
}
: 5 oikein
(
{
kone
.
Voitot
[
3
]:
C0
}
)
"
;
break
;
case
6
:
this
.
Dispatcher
.
Invoke
(()
=>
{
this
.
Background
=
Brushes
.
Pink
;
imgLotto
.
Source
=
new
BitmapImage
(
new
Uri
(
@"Resources/lotto1.png"
,
UriKind
.
Relative
));
});
s
=
$"Kierros
{
kone
.
Kierros
}
: "
;
// taas lisänumeron tarkistus
if
(
r
.
Numerot
.
Contains
(
kone
.
Voittorivi
.
Lisanumero
))
s
+=
"6+1 oikein!!! Melkein jo kannattaa?!"
;
s
+=
$
"6+1 oikein!!!
{
kone
.
Voitot
[
1
]:
C0
}
-
Melkein jo kannattaa?!"
;
else
s
+=
"6 oikein!"
;
s
+=
$
"6 oikein!
(
{
kone
.
Voitot
[
2
]:
C0
}
)
"
;
break
;
case
7
:
// Päävoitto jos osuu, niin pelin voinee pysäyttää.
s
=
$"Kierros
{
kone
.
Kierros
}
: PÄÄVOITTO!!!! JUMANTSUIKKA! Kannattaa ehkä lotota oikeastikin?! "
+
s
=
$"Kierros
{
kone
.
Kierros
}
: PÄÄVOITTO!!!!
(
{
kone
.
Voitot
[
0
]:
C0
}
)
JUMANTSUIKKA! Kannattaa ehkä lotota oikeastikin?! "
+
"Ellet käyttänyt kaikkea onneasi tähän...."
;
kaynnissa
=
false
;
break
;
...
...
@@ -176,6 +182,64 @@ namespace Lottokone
{
var
a
=
new
Asetukset
();
a
.
ShowDialog
();
// kun asetuksista palataan, voidaan ottaa uudet asetukset käyttöön.
int
curr
=
kone
.
Pelaajat
.
Count
();
// + 1 koska pelaajissa on myös meidän pelaajaolio
int
uusi
=
Properties
.
Settings
.
Default
.
Pelaajia
+
1
;
if
(
curr
<
uusi
)
{
kone
.
LisaaPelaajia
(
uusi
-
curr
,
Properties
.
Settings
.
Default
.
Riveja
);
kone
.
Status
=
$"Lisätty
{
uusi
-
curr
}
pelaajaa."
;
}
else
if
(
curr
>
uusi
)
{
kone
.
PoistaPelaajia
(
curr
-
uusi
);
kone
.
Status
=
$"Poistettu
{
curr
-
uusi
}
pelaajaa."
;
}
Pelaaja
tmp
=
kone
.
Pelaajat
.
Last
();
if
(
tmp
.
RivitVoimassa
!=
Properties
.
Settings
.
Default
.
Voimassa
)
{
kone
.
Status
=
$"Rivit voimassa
{
tmp
.
RivitVoimassa
}
->
{
Properties
.
Settings
.
Default
.
Voimassa
}
viikkoa"
;
foreach
(
Pelaaja
p
in
kone
.
Pelaajat
)
{
p
.
RivitVoimassa
=
Properties
.
Settings
.
Default
.
Voimassa
;
}
}
if
(
tmp
.
Riveja
!=
Properties
.
Settings
.
Default
.
Riveja
)
{
kone
.
Status
=
$"Simuloitujen pelaajien rivejä
{
tmp
.
Riveja
}
->
{
Properties
.
Settings
.
Default
.
Riveja
}
"
;
foreach
(
Pelaaja
p
in
kone
.
Pelaajat
)
{
p
.
Riveja
=
Properties
.
Settings
.
Default
.
Riveja
;
}
}
// saatettiin poistaa pelaajia, niin varmistetaan, että meidän pelaaja on
// yhä lotossa mukana...
if
(!
kone
.
Pelaajat
.
Contains
(
pelaaja
))
{
kone
.
Status
=
"Lisätty oma pelaaja takaisin listoille"
;
kone
.
Pelaajat
.
Add
(
pelaaja
);
}
if
(
pelaaja
.
Nimi
!=
Properties
.
Settings
.
Default
.
Nimi
)
pelaaja
.
Nimi
=
Properties
.
Settings
.
Default
.
Nimi
;
if
(
pelaaja
.
Riveja
!=
Properties
.
Settings
.
Default
.
Arparivit
+
Properties
.
Settings
.
Default
.
Vakiorivit
)
{
kone
.
Status
=
$"Omat rivit
{
pelaaja
.
Riveja
}
->
{
Properties
.
Settings
.
Default
.
Arparivit
+
Properties
.
Settings
.
Default
.
Vakiorivit
}
"
;
pelaaja
.
Riveja
=
Properties
.
Settings
.
Default
.
Arparivit
+
Properties
.
Settings
.
Default
.
Vakiorivit
;
}
if
(
pelaaja
.
RivitVoimassa
!=
Properties
.
Settings
.
Default
.
ArparivitVoimassa
)
pelaaja
.
RivitVoimassa
=
Properties
.
Settings
.
Default
.
ArparivitVoimassa
;
}
}
}
Lottokone/Model/Lotto.cs
View file @
79d4500a
...
...
@@ -79,17 +79,14 @@ namespace Lottokone.Model
public
ConcurrentBag
<
Pelaaja
>
Pelaajat
{
get
;
set
;
}
private
int
paavoitto
;
public
int
Paavoitto
// Tässä pidetään joka kierroksella jaettujen eri voittoluokkien
// palkkioiden määrät.
private
int
[]
voitot
;
public
int
[]
Voitot
{
get
{
return
paavoitto
;
}
set
{
paavoitto
=
value
;
RaisePropertyChanged
();
return
voitot
;
}
}
...
...
@@ -169,7 +166,20 @@ namespace Lottokone.Model
public
Lotto
()
{
Potti
=
0
;
Paavoitto
=
1
_250_000
;
voitot
=
new
int
[
6
];
// voitot[0]: 7 oikein
// voitot[1]: 6+1 oikein
// voitot[2]: 6 oikein
// voitot[3]: 5 oikein
// voitot[4]: 4 oikein
// voitot[5]: 3+1 oikein
// näistä potista riippumattomia voittosummia on 7, 4 ja 3+1 oikein,
// joten ne voidaan asettaa tässä.
voitot
[
0
]
=
1
_250_000
;
voitot
[
4
]
=
10
;
voitot
[
5
]
=
2
;
Viikko
=
0
;
Vuosi
=
1
;
Pelaajat
=
new
ConcurrentBag
<
Pelaaja
>();
...
...
@@ -195,6 +205,11 @@ namespace Lottokone.Model
}
}
public
void
PoistaPelaajia
(
int
maara
)
{
Pelaajat
=
new
ConcurrentBag
<
Pelaaja
>(
Pelaajat
.
Skip
(
maara
).
ToList
());
}
public
void
Tick
()
{
stopwatch
.
Reset
();
...
...
@@ -216,6 +231,7 @@ namespace Lottokone.Model
Voittorivi
=
new
Voittorivi
();
EtsiVoittajat
();
RaisePropertyChanged
(
"Rivimaara"
);
Potti
=
(
int
)(
Rivimaara
*
Properties
.
Settings
.
Default
.
Rivihinta
);
JaaVoitot
();
...
...
@@ -293,62 +309,65 @@ namespace Lottokone.Model
if
(!
oikein5
.
IsEmpty
)
{
int
voittajia
=
oikein5
.
Count
();
int
voitto
=
((
potti
/
100
)
*
3
)
/
voittajia
;
voitot
[
3
]
=
((
potti
/
100
)
*
3
)
/
voittajia
;
Status
=
$"5 oikein voittoja
{
voittajia
:
N0
}
kpl (
{
voit
t
o
:
C0
}
)"
;
Status
=
$"5 oikein voittoja
{
voittajia
:
N0
}
kpl (
{
voito
t
[
3
]
:
C0
}
)"
;
while
(
oikein5
.
TryTake
(
out
Pelaaja
p
)
!=
false
)
{
p
.
Saldo
+=
voit
t
o
;
Potti
-=
voit
t
o
;
p
.
Saldo
+=
voito
t
[
3
]
;
Potti
-=
voito
t
[
3
]
;
}
}
if
(!
oikein6
.
IsEmpty
)
{
int
voittajia
=
oikein6
.
Count
();
int
voitto
=
(
int
)((
potti
/
100
)
*
2.5
)
/
voittajia
;
voitot
[
2
]
=
(
int
)((
potti
/
100
)
*
2.5
)
/
voittajia
;
Status
=
$"6 oikein voittoja
{
voittajia
:
N0
}
kpl (
{
voit
t
o
:
C0
}
)"
;
Status
=
$"6 oikein voittoja
{
voittajia
:
N0
}
kpl (
{
voito
t
[
2
]
:
C0
}
)"
;
while
(
oikein6
.
TryTake
(
out
Pelaaja
p
)
!=
false
)
{
p
.
Saldo
+=
voit
t
o
;
Potti
-=
voit
t
o
;
p
.
Saldo
+=
voito
t
[
2
]
;
Potti
-=
voito
t
[
2
]
;
}
}
if
(!
oikein6_1
.
IsEmpty
)
{
int
voittajia
=
oikein6_1
.
Count
();
int
voitto
=
(
int
)((
potti
/
100
)
*
3.8
)
/
voittajia
;
voitot
[
1
]
=
(
int
)((
potti
/
100
)
*
3.8
)
/
voittajia
;
Status
=
$"6+1 oikein voittoja
{
voittajia
:
N0
}
kpl (
{
voit
t
o
:
C0
}
)"
;
Status
=
$"6+1 oikein voittoja
{
voittajia
:
N0
}
kpl (
{
voito
t
[
1
]
:
C0
}
)"
;
while
(
oikein6
.
TryTake
(
out
Pelaaja
p
)
!=
false
)
{
p
.
Saldo
+=
voit
t
o
;
Potti
-=
voit
t
o
;
p
.
Saldo
+=
voito
t
[
1
]
;
Potti
-=
voito
t
[
1
]
;
}
}
if
(!
oikein7
.
IsEmpty
)
{
int
voittajia
=
oikein7
.
Count
();
int
voitto
=
(
int
)(
paavoitto
/
voittajia
);
Paavoitto
=
1
_250_000
;
voitot
[
0
]
=
(
int
)(
voitot
[
0
]
/
voittajia
);
Status
=
$"!!! 7 oikein !!!!
{
voit
t
o
:
C0
}
(
{
voittajia
:
N0
}
kpl) !!!"
;
Status
=
$"!!! 7 oikein !!!!
{
voito
t
[
0
]
:
C0
}
(
{
voittajia
:
N0
}
kpl) !!!"
;
while
(
oikein7
.
TryTake
(
out
Pelaaja
p
)
!=
false
)
{
p
.
Saldo
+=
voit
t
o
;
p
.
Saldo
+=
voito
t
[
0
]
;
}
voitot
[
0
]
=
1
_250_000
;
}
else
{
Paavoitto
=
(
int
)(
Paavoitto
*
1.1
);
// n. 20 miljoonaa lienee hyvä maksimi päävoitto
if
(
voitot
[
0
]
<
20
_000_000
)
voitot
[
0
]
=
(
int
)(
voitot
[
0
]
*
1.07
);
}
RaisePropertyChanged
(
"Voitot"
);
}
protected
void
RaisePropertyChanged
([
CallerMemberName
]
string
propertyName
=
null
)
...
...
Lottokone/Model/Lottorivi.cs
View file @
79d4500a
...
...
@@ -10,15 +10,15 @@ namespace Lottokone.Model
{
public
short
Viikko
{
get
;
set
;
}
// Viikkoja, montako voimassa.
null
= ikuinen
public
Nullable
<
int
>
Voimassa
{
get
;
set
;
}
// Viikkoja, montako voimassa.
0
= ikuinen
public
int
Voimassa
{
get
;
set
;
}
public
Lottorivi
()
:
base
()
{
Voimassa
=
Properties
.
Settings
.
Default
.
Voimassa
;
}
public
Lottorivi
(
Nullable
<
int
>
voimassa
)
:
base
()
public
Lottorivi
(
int
voimassa
)
:
base
()
{
Voimassa
=
voimassa
;
}
...
...
Lottokone/Model/Pelaaja.cs
View file @
79d4500a
...
...
@@ -97,10 +97,12 @@ namespace Lottokone.Model
for
(
int
i
=
Rivit
.
Count
()
-
1
;
i
>
0
;
i
--)
{
Lottorivi
r
=
Rivit
[
i
];
if
(
r
.
Voimassa
!=
null
)
// jos rivi on tässä vaiheessa nolla viikkoa voimassa,
// niin se on ikuinen rivi, jota ei arvota uudelleen.
if
(
r
.
Voimassa
!=
0
)
{
r
.
Voimassa
--;
if
(
r
.
Voimassa
<
0
)
if
(
r
.
Voimassa
==
0
)
Rivit
.
Remove
(
r
);
}
}
...
...
Lottokone/Resources/lotto0.png
0 → 100644
View file @
79d4500a
1.21 MB
Lottokone/Resources/lotto1.png
0 → 100644
View file @
79d4500a
1.09 MB
Lottokone/Resources/lotto2.png
0 → 100644
View file @
79d4500a
1.27 MB
Lottokone/Resources/lotto3.png
0 → 100644
View file @
79d4500a
1.75 MB
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment