Click here to Skip to main content
15,884,629 members
Articles / Programming Languages / C#

War Card Game Simulation in C#

Rate me:
Please Sign up or sign in to vote.
4.77/5 (10 votes)
22 Jun 2009CPOL8 min read 85.3K   3.4K   40  
Windows Forms Application using LINQ expressions and Dictionary objects to recreate a classic card game
namespace WarGameSimulation
{
    partial class Form1
    {
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code

        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.lblPlayer1Deck = new System.Windows.Forms.Label();
            this.lblPlayer2Deck = new System.Windows.Forms.Label();
            this.lblGameStatus = new System.Windows.Forms.Label();
            this.lblShuffledDeck = new System.Windows.Forms.Label();
            this.lblGameStatusDsply = new System.Windows.Forms.Label();
            this.lblPlayer2DeckDsply = new System.Windows.Forms.Label();
            this.lblPlayer1DeckDsply = new System.Windows.Forms.Label();
            this.lblShuffledDeckDsply = new System.Windows.Forms.Label();
            this.btnNewGameStart = new System.Windows.Forms.Button();
            this.btnAutoGameStart = new System.Windows.Forms.Button();
            this.btnBattleManStart = new System.Windows.Forms.Button();
            this.lblBattleDeck = new System.Windows.Forms.Label();
            this.label2 = new System.Windows.Forms.Label();
            this.SuspendLayout();
            // 
            // lblPlayer1Deck
            // 
            this.lblPlayer1Deck.AutoSize = true;
            this.lblPlayer1Deck.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.lblPlayer1Deck.Location = new System.Drawing.Point(64, 120);
            this.lblPlayer1Deck.Name = "lblPlayer1Deck";
            this.lblPlayer1Deck.Size = new System.Drawing.Size(59, 15);
            this.lblPlayer1Deck.TabIndex = 3;
            this.lblPlayer1Deck.Text = "Player 1";
            // 
            // lblPlayer2Deck
            // 
            this.lblPlayer2Deck.AutoSize = true;
            this.lblPlayer2Deck.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.lblPlayer2Deck.Location = new System.Drawing.Point(64, 167);
            this.lblPlayer2Deck.Name = "lblPlayer2Deck";
            this.lblPlayer2Deck.Size = new System.Drawing.Size(59, 15);
            this.lblPlayer2Deck.TabIndex = 4;
            this.lblPlayer2Deck.Text = "Player 2";
            // 
            // lblGameStatus
            // 
            this.lblGameStatus.AutoSize = true;
            this.lblGameStatus.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.lblGameStatus.Location = new System.Drawing.Point(34, 261);
            this.lblGameStatus.Name = "lblGameStatus";
            this.lblGameStatus.Size = new System.Drawing.Size(89, 15);
            this.lblGameStatus.TabIndex = 8;
            this.lblGameStatus.Text = "Game Status";
            // 
            // lblShuffledDeck
            // 
            this.lblShuffledDeck.AutoSize = true;
            this.lblShuffledDeck.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.lblShuffledDeck.Location = new System.Drawing.Point(27, 73);
            this.lblShuffledDeck.Name = "lblShuffledDeck";
            this.lblShuffledDeck.Size = new System.Drawing.Size(96, 15);
            this.lblShuffledDeck.TabIndex = 9;
            this.lblShuffledDeck.Text = "Shuffled Deck";
            // 
            // lblGameStatusDsply
            // 
            this.lblGameStatusDsply.AutoSize = true;
            this.lblGameStatusDsply.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.lblGameStatusDsply.Location = new System.Drawing.Point(125, 261);
            this.lblGameStatusDsply.Name = "lblGameStatusDsply";
            this.lblGameStatusDsply.Size = new System.Drawing.Size(16, 15);
            this.lblGameStatusDsply.TabIndex = 16;
            this.lblGameStatusDsply.Text = "...";
            // 
            // lblPlayer2DeckDsply
            // 
            this.lblPlayer2DeckDsply.AutoSize = true;
            this.lblPlayer2DeckDsply.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.lblPlayer2DeckDsply.Location = new System.Drawing.Point(125, 167);
            this.lblPlayer2DeckDsply.MaximumSize = new System.Drawing.Size(700, 30);
            this.lblPlayer2DeckDsply.Name = "lblPlayer2DeckDsply";
            this.lblPlayer2DeckDsply.Size = new System.Drawing.Size(16, 15);
            this.lblPlayer2DeckDsply.TabIndex = 14;
            this.lblPlayer2DeckDsply.Text = "...";
            // 
            // lblPlayer1DeckDsply
            // 
            this.lblPlayer1DeckDsply.AutoSize = true;
            this.lblPlayer1DeckDsply.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.lblPlayer1DeckDsply.Location = new System.Drawing.Point(125, 120);
            this.lblPlayer1DeckDsply.MaximumSize = new System.Drawing.Size(700, 30);
            this.lblPlayer1DeckDsply.Name = "lblPlayer1DeckDsply";
            this.lblPlayer1DeckDsply.Size = new System.Drawing.Size(16, 15);
            this.lblPlayer1DeckDsply.TabIndex = 13;
            this.lblPlayer1DeckDsply.Text = "...";
            // 
            // lblShuffledDeckDsply
            // 
            this.lblShuffledDeckDsply.AutoSize = true;
            this.lblShuffledDeckDsply.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.lblShuffledDeckDsply.Location = new System.Drawing.Point(125, 73);
            this.lblShuffledDeckDsply.MaximumSize = new System.Drawing.Size(700, 30);
            this.lblShuffledDeckDsply.Name = "lblShuffledDeckDsply";
            this.lblShuffledDeckDsply.Size = new System.Drawing.Size(16, 15);
            this.lblShuffledDeckDsply.TabIndex = 17;
            this.lblShuffledDeckDsply.Text = "...";
            // 
            // btnNewGameStart
            // 
            this.btnNewGameStart.Location = new System.Drawing.Point(27, 24);
            this.btnNewGameStart.Name = "btnNewGameStart";
            this.btnNewGameStart.Size = new System.Drawing.Size(75, 23);
            this.btnNewGameStart.TabIndex = 18;
            this.btnNewGameStart.Text = "New Game";
            this.btnNewGameStart.UseVisualStyleBackColor = true;
            this.btnNewGameStart.Click += new System.EventHandler(this.btnNewGameStart_Click);
            // 
            // btnAutoGameStart
            // 
            this.btnAutoGameStart.Enabled = false;
            this.btnAutoGameStart.Location = new System.Drawing.Point(119, 24);
            this.btnAutoGameStart.Name = "btnAutoGameStart";
            this.btnAutoGameStart.Size = new System.Drawing.Size(75, 23);
            this.btnAutoGameStart.TabIndex = 19;
            this.btnAutoGameStart.Text = "Auto Game";
            this.btnAutoGameStart.UseVisualStyleBackColor = true;
            this.btnAutoGameStart.Click += new System.EventHandler(this.btnAutoGameStart_Click);
            // 
            // btnBattleManStart
            // 
            this.btnBattleManStart.Enabled = false;
            this.btnBattleManStart.Location = new System.Drawing.Point(211, 24);
            this.btnBattleManStart.Name = "btnBattleManStart";
            this.btnBattleManStart.Size = new System.Drawing.Size(75, 23);
            this.btnBattleManStart.TabIndex = 20;
            this.btnBattleManStart.Text = "Battle";
            this.btnBattleManStart.UseVisualStyleBackColor = true;
            this.btnBattleManStart.Click += new System.EventHandler(this.btnBattleManStart_Click);
            // 
            // lblBattleDeck
            // 
            this.lblBattleDeck.AutoSize = true;
            this.lblBattleDeck.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.lblBattleDeck.Location = new System.Drawing.Point(125, 214);
            this.lblBattleDeck.MaximumSize = new System.Drawing.Size(700, 30);
            this.lblBattleDeck.Name = "lblBattleDeck";
            this.lblBattleDeck.Size = new System.Drawing.Size(16, 15);
            this.lblBattleDeck.TabIndex = 22;
            this.lblBattleDeck.Text = "...";
            // 
            // label2
            // 
            this.label2.AutoSize = true;
            this.label2.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label2.Location = new System.Drawing.Point(50, 214);
            this.label2.Name = "label2";
            this.label2.Size = new System.Drawing.Size(73, 15);
            this.label2.TabIndex = 21;
            this.label2.Text = "War Cards";
            // 
            // Form1
            // 
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(867, 541);
            this.Controls.Add(this.lblBattleDeck);
            this.Controls.Add(this.label2);
            this.Controls.Add(this.btnBattleManStart);
            this.Controls.Add(this.btnAutoGameStart);
            this.Controls.Add(this.btnNewGameStart);
            this.Controls.Add(this.lblShuffledDeckDsply);
            this.Controls.Add(this.lblGameStatusDsply);
            this.Controls.Add(this.lblPlayer2DeckDsply);
            this.Controls.Add(this.lblPlayer1DeckDsply);
            this.Controls.Add(this.lblShuffledDeck);
            this.Controls.Add(this.lblGameStatus);
            this.Controls.Add(this.lblPlayer2Deck);
            this.Controls.Add(this.lblPlayer1Deck);
            this.Name = "Form1";
            this.Text = "War Game Simulation";
            this.ResumeLayout(false);
            this.PerformLayout();

        }

        #endregion

        private System.Windows.Forms.Label lblPlayer1Deck;
        private System.Windows.Forms.Label lblPlayer2Deck;
        private System.Windows.Forms.Label lblGameStatus;
        private System.Windows.Forms.Label lblShuffledDeck;
        private System.Windows.Forms.Label lblGameStatusDsply;
        private System.Windows.Forms.Label lblPlayer2DeckDsply;
        private System.Windows.Forms.Label lblPlayer1DeckDsply;
        private System.Windows.Forms.Label lblShuffledDeckDsply;
        private System.Windows.Forms.Button btnNewGameStart;
        private System.Windows.Forms.Button btnAutoGameStart;
        private System.Windows.Forms.Button btnBattleManStart;
        private System.Windows.Forms.Label lblBattleDeck;
        private System.Windows.Forms.Label label2;
    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior) Paychex
United States United States
I am a senior software developer, architect, and project manager, specializing in .NET, JavaScript, Java, and database development, and build automation. I am currently a Lead Developer (.NET) / Developer IV for Paychex Enterprise Business Solutions. Paychex (PAYX) provides payroll, human resources, and benefits outsourcing and web-based solutions to business.

Prior to Paychex, I served as Lead Software Engineer, Operations Manager, and Technical Product Manager at Bio-Optronics. Bio-Optronics develops, deploys and operates information technology solutions to help healthcare professionals manage and optimize workflow to enhance quality, productivity, and patient and staff satisfaction and safety. Previously, I held positions of President, COO, Chief Technology Officer (CTO), and SVP of Technology for Lazer Incorporated. Lazer is a successful, digital imaging and Internet-based content management services provider.

Comments and Discussions