Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
puzzleplayer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Floris
puzzleplayer
Compare revisions
2adda90e41ee8336195e4aad4ff6dd426764681d to 336cbf6f7f05a50052c24066cae994a79c6e45a8
Compare revisions
Changes are shown as if the
source
revision was being merged into the
target
revision.
Learn more about comparing revisions.
Source
8783497/puzzleplayer
Select target project
No results found
336cbf6f7f05a50052c24066cae994a79c6e45a8
Select Git revision
Branches
MidtermBuild
main
Swap
Target
8783497/puzzleplayer
Select target project
8783497/puzzleplayer
1 result
2adda90e41ee8336195e4aad4ff6dd426764681d
Select Git revision
Branches
MidtermBuild
main
Show changes
Only incoming changes from source
Include changes to target since source was created
Compare
Commits on Source (2)
added All in button for blackjack
· 1345e489
bionic85
authored
2 months ago
most importand feature yet
1345e489
Merge branch 'main' of
https://git.science.uu.nl/8783497/puzzleplayer
· 336cbf6f
bionic85
authored
2 months ago
336cbf6f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
PuzzlePlayer/BlackJack.cs
+37
-7
37 additions, 7 deletions
PuzzlePlayer/BlackJack.cs
PuzzlePlayer/PuzzlePlayer.cs
+2
-13
2 additions, 13 deletions
PuzzlePlayer/PuzzlePlayer.cs
with
39 additions
and
20 deletions
PuzzlePlayer/BlackJack.cs
View file @
336cbf6f
...
...
@@ -43,7 +43,7 @@ namespace PuzzlePlayer_Namespace
const
int
BLACKJACK
=
21
;
//the value to get blackjack
Size
screen
=
Screen
.
PrimaryScreen
.
WorkingArea
.
Size
;
Brush
TEXTBRUSH
=
Brushes
.
Black
;
// visibility depends on game state
Panel
SetupPanel
;
Panel
GamePanel
;
...
...
@@ -139,6 +139,28 @@ namespace PuzzlePlayer_Namespace
dealButton
.
Click
+=
DealButtonClick
;
SetupPanel
.
Controls
.
Add
(
dealButton
);
// ALL IN BUTTON
Button
allIn
=
new
Button
();
allIn
.
Text
=
"!ALL IN!"
;
allIn
.
Size
=
new
Size
(
SetupPanel
.
Width
/
4
,
SetupPanel
.
Height
/
4
);
allIn
.
Location
=
new
Point
(
SetupPanel
.
Width
-
allIn
.
Width
-
20
,
SetupPanel
.
Height
/
4
);
allIn
.
Font
=
new
Font
(
BJFont
,
allIn
.
Size
.
Width
/
5
);
allIn
.
BackColor
=
Color
.
Red
;
allIn
.
ForeColor
=
Color
.
DarkRed
;
allIn
.
Click
+=
AllInButtonClick
;
SetupPanel
.
Controls
.
Add
(
allIn
);
// ALL IN BUTTON
Button
allIn2
=
new
Button
();
allIn2
.
Text
=
"!ALL IN!"
;
allIn2
.
Size
=
new
Size
(
SetupPanel
.
Width
/
4
,
SetupPanel
.
Height
/
4
);
allIn2
.
Location
=
new
Point
(
20
,
SetupPanel
.
Height
/
4
);
allIn2
.
Font
=
new
Font
(
BJFont
,
allIn2
.
Size
.
Width
/
5
);
allIn2
.
BackColor
=
Color
.
Red
;
allIn2
.
ForeColor
=
Color
.
DarkRed
;
allIn2
.
Click
+=
AllInButtonClick
;
SetupPanel
.
Controls
.
Add
(
allIn2
);
Controls
.
Add
(
SetupPanel
);
#
endregion
...
...
@@ -194,6 +216,14 @@ namespace PuzzlePlayer_Namespace
#
endregion
}
private
void
AllInButtonClick
(
object
sender
,
EventArgs
e
)
{
deployedMoney
+=
UserDataManager
.
Money
;
UserDataManager
.
Money
=
0
;
Invalidate
(
true
);
}
//button logic
private
void
MoneyButtonClick
(
object
sender
,
EventArgs
e
)
{
...
...
@@ -332,7 +362,7 @@ namespace PuzzlePlayer_Namespace
{
Graphics
g
=
e
.
Graphics
;
Brush
paintBrush
=
new
SolidBrush
(
UserDataManager
.
Theme
.
secondaryColor
);
DrawMoney
(
g
,
paintBrush
);
DrawMoney
(
g
,
TEXTBRUSH
);
// draw deployd money
// Might update this to butiful chipss TODO
...
...
@@ -341,14 +371,14 @@ namespace PuzzlePlayer_Namespace
SizeF
pf
=
g
.
MeasureString
(
s
,
deplMoneyFont
);
PointF
p
=
new
PointF
(
SetupPanel
.
Width
/
2
-
pf
.
Width
/
2
,
SetupPanel
.
Height
/
2
);
g
.
DrawString
(
s
,
deplMoneyFont
,
paintBrush
,
p
);
g
.
DrawString
(
s
,
deplMoneyFont
,
TEXTBRUSH
,
p
);
}
private
void
Game_Paint
(
object
sender
,
PaintEventArgs
e
)
{
Graphics
g
=
e
.
Graphics
;
Brush
paintBrush
=
new
SolidBrush
(
UserDataManager
.
Theme
.
secondaryColor
);
DrawMoney
(
g
,
paintBrush
);
DrawMoney
(
g
,
TEXTBRUSH
);
int
cardWidth
=
screen
.
Width
/
8
;
//lucky number
int
cardHeight
=
(
int
)(
cardWidth
*
cardMultply
);
...
...
@@ -379,17 +409,17 @@ namespace PuzzlePlayer_Namespace
SizeF
playerSF
=
g
.
MeasureString
(
playerString
,
f
);
PointF
playerStrPos
=
new
PointF
(
GamePanel
.
Width
/
2
-
playerSF
.
Width
/
2
,
GamePanel
.
Height
-
cardHeight
-
playerSF
.
Height
);
g
.
DrawString
(
playerString
,
f
,
paintBrush
,
playerStrPos
);
g
.
DrawString
(
playerString
,
f
,
TEXTBRUSH
,
playerStrPos
);
SizeF
dealerSF
=
g
.
MeasureString
(
dealerString
,
f
);
PointF
dealerStrPos
=
new
PointF
(
GamePanel
.
Width
/
2
-
dealerSF
.
Width
/
2
,
cardHeight
);
g
.
DrawString
(
dealerString
,
f
,
paintBrush
,
dealerStrPos
);
g
.
DrawString
(
dealerString
,
f
,
TEXTBRUSH
,
dealerStrPos
);
//draw deployed money
string
deployedString
=
$"Playing for $
{
deployedMoney
}
"
;
SizeF
deployedSF
=
g
.
MeasureString
(
deployedString
,
f
);
PointF
deployedStrPos
=
new
PointF
(
GamePanel
.
Width
/
2
-
deployedSF
.
Width
/
2
,
GamePanel
.
Height
/
2
-
deployedSF
.
Height
/
2
);
g
.
DrawString
(
deployedString
,
f
,
paintBrush
,
deployedStrPos
);
g
.
DrawString
(
deployedString
,
f
,
TEXTBRUSH
,
deployedStrPos
);
// draw result text when ready
if
(
resultReady
)
...
...
This diff is collapsed.
Click to expand it.
PuzzlePlayer/PuzzlePlayer.cs
View file @
336cbf6f
...
...
@@ -183,19 +183,7 @@ namespace PuzzlePlayer_Namespace
blackJackButton
.
Click
+=
(
object
o
,
EventArgs
e
)
=>
{
this
.
Hide
();
bj
.
FormClosed
+=
(
object
o
,
FormClosedEventArgs
fcea
)
=>
{
this
.
BackColor
=
UserDataManager
.
Theme
.
primaryColor
;
this
.
ForeColor
=
UserDataManager
.
Theme
.
tertiaryColor
;
foreach
(
Control
control
in
this
.
Controls
)
{
SettingForm
.
UpdateControl
(
control
);
}
this
.
Show
();
bj
=
new
BlackJack
();
};
bj
.
FormClosed
+=
ReShowFormHandler
;
bj
.
Show
();
};
...
...
@@ -216,6 +204,7 @@ namespace PuzzlePlayer_Namespace
private
void
ReShowFormHandler
(
object
o
,
FormClosedEventArgs
e
)
{
SetUpPuzzleForms
();
// To make sure they have the right colours
bj
=
new
BlackJack
();
this
.
BackColor
=
UserDataManager
.
Theme
.
primaryColor
;
...
...
This diff is collapsed.
Click to expand it.