Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Z
Zsirozas
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
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Sillinger Péter
Zsirozas
Commits
6b2711b1
Commit
6b2711b1
authored
Dec 9, 2019
by
Sillinger Péter
Browse files
Options
Downloads
Patches
Plain Diff
Almost done. GameOver condition is buggy, overall game seems to work.
parent
1d4cfcd2
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
zsirozas/Form1.Designer.cs
+2
-2
2 additions, 2 deletions
zsirozas/Form1.Designer.cs
zsirozas/Form1.cs
+23
-24
23 additions, 24 deletions
zsirozas/Form1.cs
zsirozas/Game.cs
+4
-3
4 additions, 3 deletions
zsirozas/Game.cs
zsirozas/GameClient.cs
+0
-1
0 additions, 1 deletion
zsirozas/GameClient.cs
with
29 additions
and
30 deletions
zsirozas/Form1.Designer.cs
+
2
−
2
View file @
6b2711b1
...
...
@@ -482,7 +482,7 @@
this
.
labelDeckCnt
.
Name
=
"labelDeckCnt"
;
this
.
labelDeckCnt
.
Size
=
new
System
.
Drawing
.
Size
(
93
,
31
);
this
.
labelDeckCnt
.
TabIndex
=
0
;
this
.
labelDeckCnt
.
Text
=
"
12
lap"
;
this
.
labelDeckCnt
.
Text
=
"
XYZ
lap"
;
//
// panelCards
//
...
...
@@ -550,7 +550,7 @@
this
.
buttonEndTurn
.
Name
=
"buttonEndTurn"
;
this
.
buttonEndTurn
.
Size
=
new
System
.
Drawing
.
Size
(
143
,
69
);
this
.
buttonEndTurn
.
TabIndex
=
5
;
this
.
buttonEndTurn
.
Text
=
"
button1
"
;
this
.
buttonEndTurn
.
Text
=
"
Kör vége
"
;
this
.
buttonEndTurn
.
UseVisualStyleBackColor
=
true
;
this
.
buttonEndTurn
.
Click
+=
new
System
.
EventHandler
(
this
.
buttonEndTurn_Click
);
//
...
...
This diff is collapsed.
Click to expand it.
zsirozas/Form1.cs
+
23
−
24
View file @
6b2711b1
...
...
@@ -33,8 +33,8 @@ namespace zsirozas
{
if
(
client
.
UseCard
(
3
))
{
buttonCard
0
.
Enabled
=
false
;
buttonCard
0
.
Visible
=
false
;
buttonCard
3
.
Enabled
=
false
;
buttonCard
3
.
Visible
=
false
;
}
}
...
...
@@ -42,8 +42,8 @@ namespace zsirozas
{
if
(
client
.
UseCard
(
2
))
{
buttonCard
0
.
Enabled
=
false
;
buttonCard
0
.
Visible
=
false
;
buttonCard
2
.
Enabled
=
false
;
buttonCard
2
.
Visible
=
false
;
}
}
...
...
@@ -51,8 +51,8 @@ namespace zsirozas
{
if
(
client
.
UseCard
(
1
))
{
buttonCard
0
.
Enabled
=
false
;
buttonCard
0
.
Visible
=
false
;
buttonCard
1
.
Enabled
=
false
;
buttonCard
1
.
Visible
=
false
;
}
}
...
...
@@ -192,43 +192,42 @@ namespace zsirozas
labelDeckCnt
.
Text
=
client
.
gameState
.
remainsInDeck
+
"lap"
;
if
(
client
.
gameState
.
cardsOnTable
.
Length
>
0
)
{
labelTurnCard
.
Text
=
client
.
gameState
.
cardsOnTable
[
0
].
ToString
();
}
else
{
labelTurnCard
.
Text
=
""
;
}
for
(
int
i
=
1
;
i
<
client
.
gameState
.
numofCardsInHands
.
Length
;
i
++)
for
(
int
i
=
0
;
i
<
client
.
gameState
.
numofCardsInHands
.
Length
-
1
;
i
++)
{
int
idx
=
(
i
+
client
.
playerIDX
)
%
client
.
gameState
.
numofCardsInHands
.
Length
;
playerNameLabels
[
i
dx
].
Visible
=
true
;
playerNameLabels
[
i
dx
].
Visible
=
true
;
int
idx
=
(
i
+
client
.
playerIDX
+
1
)
%
client
.
gameState
.
numofCardsInHands
.
Length
;
playerNameLabels
[
i
].
Visible
=
true
;
playerNameLabels
[
i
].
Visible
=
true
;
playerNameLabels
[
i
dx
].
Text
=
client
.
gameState
.
playersByOrder
[
i
];
playerCardLabels
[
i
dx
].
Text
=
client
.
gameState
.
numofCardsInHands
.
Length
.
ToString
();
if
(
client
.
gameState
.
startingPlayer
==
i
)
playerNameLabels
[
i
].
Text
=
client
.
gameState
.
playersByOrder
[
i
dx
];
playerCardLabels
[
i
].
Text
=
client
.
gameState
.
numofCardsInHands
[
idx
]
.
ToString
();
if
(
client
.
gameState
.
startingPlayer
==
i
dx
)
{
playerNameLabels
[
i
dx
].
BackColor
=
Color
.
Cyan
;
playerNameLabels
[
i
dx
].
BackColor
=
Color
.
Cyan
;
playerNameLabels
[
i
].
BackColor
=
Color
.
Cyan
;
playerNameLabels
[
i
].
BackColor
=
Color
.
Cyan
;
}
else
{
playerNameLabels
[
i
dx
].
BackColor
=
Color
.
Transparent
;
playerNameLabels
[
i
dx
].
BackColor
=
Color
.
Transparent
;
playerNameLabels
[
i
].
BackColor
=
Color
.
Transparent
;
playerNameLabels
[
i
].
BackColor
=
Color
.
Transparent
;
}
if
(
client
.
gameState
.
lastToHit
==
i
)
if
(
client
.
gameState
.
lastToHit
==
i
dx
)
{
playerNameLabels
[
i
dx
].
BackColor
=
Color
.
Yellow
;
playerNameLabels
[
i
dx
].
BackColor
=
Color
.
Yellow
;
playerNameLabels
[
i
].
BackColor
=
Color
.
Yellow
;
playerNameLabels
[
i
].
BackColor
=
Color
.
Yellow
;
}
else
{
playerNameLabels
[
i
dx
].
BackColor
=
Color
.
Transparent
;
playerNameLabels
[
i
dx
].
BackColor
=
Color
.
Transparent
;
playerNameLabels
[
i
].
BackColor
=
Color
.
Transparent
;
playerNameLabels
[
i
].
BackColor
=
Color
.
Transparent
;
}
}
for
(
int
i
=
0
;
i
<
playerNameLabels
.
Length
;
i
++)
for
(
int
i
=
client
.
gameState
.
numofCardsInHands
.
Length
-
1
;
i
<
playerNameLabels
.
Length
;
i
++)
{
playerNameLabels
[
i
].
Visible
=
false
;
playerCardLabels
[
i
].
Visible
=
false
;
...
...
This diff is collapsed.
Click to expand it.
zsirozas/Game.cs
+
4
−
3
View file @
6b2711b1
...
...
@@ -83,7 +83,7 @@ namespace zsirozas
public
void
ValidPlayerMakesCardActionInValidTurnWithValidCard
(
string
playerID
,
int
cardID
)
{
//I
d
said player has started the turn...
//I
f
said player has started the turn...
if
(
playersByOrder
[
currentRound
.
startingPlayer
]
==
playerID
)
{
//...he has to hit it to continue
...
...
@@ -116,8 +116,8 @@ namespace zsirozas
currentRound
.
nextUp
=
(
currentRound
.
nextUp
+
1
)
%
playersByOrder
.
Length
;
NotifyPlayers
(
GameEvent
.
CardAction
);
}
//playersByID[playersByOrder[currentRound.nextUp]].Invoke(
);
currentRound
.
nextUp
=
(
currentRound
.
nextUp
+
1
)
%
playersByOrder
.
Length
;
NotifyPlayers
(
GameEvent
.
CardAction
);
}
...
...
@@ -132,6 +132,7 @@ namespace zsirozas
//Has this turn tecnically ended?
if
(
playersByOrder
[
currentRound
.
lastToHit
]
==
playerID
&&
currentRound
.
playedCards
.
Count
>
0
)
{
//TODO: BUG: akkor is ezt adja, ha nem mi jövünk
Complain
(
"Objection! You already won this round!"
);
}
else
...
...
This diff is collapsed.
Click to expand it.
zsirozas/GameClient.cs
+
0
−
1
View file @
6b2711b1
...
...
@@ -323,6 +323,5 @@ namespace zsirozas
// to infer the type to cast x to
return
(
T
)
x
;
}
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment