diff --git a/zsirozas/Form1.Designer.cs b/zsirozas/Form1.Designer.cs index b3c655b30a7b3ecb1fdabc02df2bd13e67358752..641e724db1dcdb671de9fa742677b69256f374bc 100644 --- a/zsirozas/Form1.Designer.cs +++ b/zsirozas/Form1.Designer.cs @@ -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); // diff --git a/zsirozas/Form1.cs b/zsirozas/Form1.cs index 5d75b36ffd8352ccd81e3b310d51bb6c22445eb4..c47c63f196076018c465c29aca87bb60237a77a3 100644 --- a/zsirozas/Form1.cs +++ b/zsirozas/Form1.cs @@ -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; diff --git a/zsirozas/Game.cs b/zsirozas/Game.cs index 592e5bb5b168b12547aeda295c15e78fa2347072..87789809603b25068591832d10072c0153235bc7 100644 --- a/zsirozas/Game.cs +++ b/zsirozas/Game.cs @@ -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 diff --git a/zsirozas/GameClient.cs b/zsirozas/GameClient.cs index 51c170da741272896d68bfa9e8613e46a32b87d8..4e0b23c1f23a616898833588543625b571d3ffaf 100644 --- a/zsirozas/GameClient.cs +++ b/zsirozas/GameClient.cs @@ -323,6 +323,5 @@ namespace zsirozas // to infer the type to cast x to return (T)x; } - } }