Skip to content
Snippets Groups Projects
Commit 6b2711b1 authored by Sillinger Péter's avatar Sillinger Péter
Browse files

Almost done. GameOver condition is buggy, overall game seems to work.

parent 1d4cfcd2
Branches
No related tags found
No related merge requests found
......@@ -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);
//
......
......@@ -33,8 +33,8 @@ namespace zsirozas
{
if (client.UseCard(3))
{
buttonCard0.Enabled = false;
buttonCard0.Visible = false;
buttonCard3.Enabled = false;
buttonCard3.Visible = false;
}
}
......@@ -42,8 +42,8 @@ namespace zsirozas
{
if (client.UseCard(2))
{
buttonCard0.Enabled = false;
buttonCard0.Visible = false;
buttonCard2.Enabled = false;
buttonCard2.Visible = false;
}
}
......@@ -51,8 +51,8 @@ namespace zsirozas
{
if (client.UseCard(1))
{
buttonCard0.Enabled = false;
buttonCard0.Visible = false;
buttonCard1.Enabled = false;
buttonCard1.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[idx].Visible = true;
playerNameLabels[idx].Visible = true;
int idx = (i + client.playerIDX + 1) % client.gameState.numofCardsInHands.Length;
playerNameLabels[i].Visible = true;
playerNameLabels[i].Visible = true;
playerNameLabels[idx].Text = client.gameState.playersByOrder[i];
playerCardLabels[idx].Text = client.gameState.numofCardsInHands.Length.ToString();
if (client.gameState.startingPlayer == i)
playerNameLabels[i].Text = client.gameState.playersByOrder[idx];
playerCardLabels[i].Text = client.gameState.numofCardsInHands[idx].ToString();
if (client.gameState.startingPlayer == idx)
{
playerNameLabels[idx].BackColor = Color.Cyan;
playerNameLabels[idx].BackColor = Color.Cyan;
playerNameLabels[i].BackColor = Color.Cyan;
playerNameLabels[i].BackColor = Color.Cyan;
}
else
{
playerNameLabels[idx].BackColor = Color.Transparent;
playerNameLabels[idx].BackColor = Color.Transparent;
playerNameLabels[i].BackColor = Color.Transparent;
playerNameLabels[i].BackColor = Color.Transparent;
}
if (client.gameState.lastToHit == i)
if (client.gameState.lastToHit == idx)
{
playerNameLabels[idx].BackColor = Color.Yellow;
playerNameLabels[idx].BackColor = Color.Yellow;
playerNameLabels[i].BackColor = Color.Yellow;
playerNameLabels[i].BackColor = Color.Yellow;
}
else
{
playerNameLabels[idx].BackColor = Color.Transparent;
playerNameLabels[idx].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;
......
......@@ -83,7 +83,7 @@ namespace zsirozas
public void ValidPlayerMakesCardActionInValidTurnWithValidCard(string playerID, int cardID)
{
//Id said player has started the turn...
//If 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
......
......@@ -323,6 +323,5 @@ namespace zsirozas
// to infer the type to cast x to
return (T)x;
}
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment