Logging added points
This commit is contained in:
@ -23,6 +23,8 @@ namespace WinGreed
|
||||
private HandleThrow _ht;
|
||||
public string Player { get; set; }
|
||||
public int TotPoints { get; set; }
|
||||
public int AddedPoints { get; set; }
|
||||
|
||||
List<int> Points = new List<int>();
|
||||
public frmPersonRound(string player)
|
||||
{
|
||||
@ -193,6 +195,7 @@ namespace WinGreed
|
||||
actTxtBox.Refresh();
|
||||
tempChsn += outPut.NumSum;
|
||||
txtChosenPoints.Text = tempChsn.ToString();
|
||||
AddedPoints = tempChsn;
|
||||
if (((TextBox)this.Controls.Find($"txtMaxValue{row}", true).FirstOrDefault()).Text == actTxtBox.Text
|
||||
&& int.Parse(actTxtBox.Text.Trim()) > 0
|
||||
&& _ht.Dices.Count(x => x.Chosen == true) == _ht.Dices.Count)
|
||||
@ -202,8 +205,8 @@ namespace WinGreed
|
||||
}
|
||||
}
|
||||
|
||||
numbers.ForEach(x => Debug.Write($"{x}, "));
|
||||
Debug.WriteLine(" -");
|
||||
//numbers.ForEach(x => Debug.Write($"{x}, "));
|
||||
//Debug.WriteLine(" -");
|
||||
return result;
|
||||
|
||||
}
|
||||
|
||||
28
WinGreed/frmStart.Designer.cs
generated
28
WinGreed/frmStart.Designer.cs
generated
@ -38,6 +38,8 @@
|
||||
this.txtNewName = new System.Windows.Forms.TextBox();
|
||||
this.btnAddOk = new System.Windows.Forms.Button();
|
||||
this.btnSound = new System.Windows.Forms.Button();
|
||||
this.lstLogBox = new System.Windows.Forms.ListBox();
|
||||
this.lblLog = new System.Windows.Forms.Label();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// label1
|
||||
@ -72,7 +74,7 @@
|
||||
this.lvMemberList.HoverSelection = true;
|
||||
this.lvMemberList.Location = new System.Drawing.Point(387, 97);
|
||||
this.lvMemberList.Name = "lvMemberList";
|
||||
this.lvMemberList.Size = new System.Drawing.Size(302, 166);
|
||||
this.lvMemberList.Size = new System.Drawing.Size(302, 315);
|
||||
this.lvMemberList.TabIndex = 2;
|
||||
this.lvMemberList.UseCompatibleStateImageBehavior = false;
|
||||
this.lvMemberList.View = System.Windows.Forms.View.Details;
|
||||
@ -134,11 +136,31 @@
|
||||
this.btnSound.Visible = false;
|
||||
this.btnSound.Click += new System.EventHandler(this.btnSound_Click);
|
||||
//
|
||||
// lstLogBox
|
||||
//
|
||||
this.lstLogBox.FormattingEnabled = true;
|
||||
this.lstLogBox.ItemHeight = 15;
|
||||
this.lstLogBox.Location = new System.Drawing.Point(707, 97);
|
||||
this.lstLogBox.Name = "lstLogBox";
|
||||
this.lstLogBox.Size = new System.Drawing.Size(120, 319);
|
||||
this.lstLogBox.TabIndex = 7;
|
||||
//
|
||||
// lblLog
|
||||
//
|
||||
this.lblLog.AutoSize = true;
|
||||
this.lblLog.Location = new System.Drawing.Point(707, 66);
|
||||
this.lblLog.Name = "lblLog";
|
||||
this.lblLog.Size = new System.Drawing.Size(68, 15);
|
||||
this.lblLog.TabIndex = 8;
|
||||
this.lblLog.Text = "PoängLogg";
|
||||
//
|
||||
// frmStart
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(800, 450);
|
||||
this.ClientSize = new System.Drawing.Size(897, 450);
|
||||
this.Controls.Add(this.lblLog);
|
||||
this.Controls.Add(this.lstLogBox);
|
||||
this.Controls.Add(this.btnSound);
|
||||
this.Controls.Add(this.btnAddOk);
|
||||
this.Controls.Add(this.txtNewName);
|
||||
@ -166,5 +188,7 @@
|
||||
private TextBox txtNewName;
|
||||
private Button btnAddOk;
|
||||
private Button btnSound;
|
||||
private ListBox lstLogBox;
|
||||
private Label lblLog;
|
||||
}
|
||||
}
|
||||
@ -20,10 +20,16 @@ namespace WinGreed
|
||||
{
|
||||
var nextLvInstance = lvMemberList.Items[NextLvItem()];
|
||||
var nextPlayerName = nextLvInstance.Text;
|
||||
fPR = new frmPersonRound(nextPlayerName);
|
||||
fPR.TotPoints = int.Parse(nextLvInstance.SubItems[2].Text);
|
||||
fPR.ShowDialog();
|
||||
nextLvInstance.SubItems[2].Text = fPR.TotPoints.ToString();
|
||||
|
||||
if (!GameOver || (GameOver && nextLvInstance != gocFirst.lvsave))
|
||||
{
|
||||
fPR = new frmPersonRound(nextPlayerName);
|
||||
fPR.TotPoints = int.Parse(nextLvInstance.SubItems[2].Text);
|
||||
fPR.ShowDialog();
|
||||
nextLvInstance.SubItems[2].Text = fPR.TotPoints.ToString();
|
||||
lstLogBox.Items.Add($"{nextPlayerName} -> {fPR.AddedPoints} po<70>ng.");
|
||||
}
|
||||
|
||||
if (GameOver)
|
||||
{
|
||||
if (nextLvInstance == gocFirst.lvsave)
|
||||
|
||||
Reference in New Issue
Block a user