Ejemplo n.º 1
0
        /// <summary>
        /// Creates a new game.
        /// </summary>
        /// <param name="numPlayers"></param>
        /// <param name="gameFlags"></param>
        /// <param name="gg"></param>
        public Game(int numPlayers, int gameFlags, GameGui gg)
        {
            m_Gg = gg;
            Initialize(numPlayers, gameFlags); //removed exception handling for release, so throw away bool
            m_Gg.SetupGui();
            m_Gg.UpdateDisplay(m_Players);     //arranges red backgrounds according to number of players
            m_Gg.UpdateElements(m_Players);    //adds cardboxes to screen based on players hands
            Round rnd = new Round();

            rnd.Initialize(this, m_Players);//game is ready for input
            m_Rounds.Add(rnd);
        }
Ejemplo n.º 2
0
        public void outputStatusToWindow(ref GameGui gg)
        {
            foreach (Turn turn in this)
            {
                Player myPlayer = turn.GetPlayer();
                switch (myPlayer.ID)
                {
                case 0:
                    gg.lblPlayer0.Content = "Player 0 (" + ((PlayerType.computer == myPlayer.GetMode())?"computer":"human") + ") round " + GetHashCode().ToString() + " turn no. " + turn.GetHashCode().ToString();
                    Game.WriteToLog(gg.lblPlayer0.Content.ToString());
                    break;

                case 1:
                    gg.lblPlayer1.Content = "Player 1 (" + ((PlayerType.computer == myPlayer.GetMode()) ? "computer" : "human") + ") round " + GetHashCode().ToString() + " turn no. " + turn.GetHashCode().ToString();
                    Game.WriteToLog(gg.lblPlayer1.Content.ToString());
                    break;

                case 2:
                    gg.lblPlayer2.Content = "Player 2 (" + ((PlayerType.computer == myPlayer.GetMode()) ? "computer" : "human") + ") round " + GetHashCode().ToString() + " turn no. " + turn.GetHashCode().ToString();
                    Game.WriteToLog(gg.lblPlayer2.Content.ToString());
                    break;

                case 3:
                    gg.lblPlayer3.Content = "Player 3 (" + ((PlayerType.computer == myPlayer.GetMode()) ? "computer" : "human") + ") round " + GetHashCode().ToString() + " turn no. " + turn.GetHashCode().ToString();
                    break;

                case 4:
                    gg.lblPlayer4.Content = "Player 4 (" + ((PlayerType.computer == myPlayer.GetMode()) ? "computer" : "human") + ") round " + GetHashCode().ToString() + " turn no. " + turn.GetHashCode().ToString();
                    break;

                case 5:
                    gg.lblPlayer5.Content = "Player 5 (" + ((PlayerType.computer == myPlayer.GetMode()) ? "computer" : "human") + ") round " + GetHashCode().ToString() + " turn no. " + turn.GetHashCode().ToString();
                    break;

                default:
                    break;
                }
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="turn"></param>
        /// <param name="gg"></param>
        public void updateBoldedStatus(Turn turn, ref GameGui gg)
        {
            gg.lblPlayer0.FontWeight = FontWeights.Normal;
            gg.lblPlayer1.FontWeight = FontWeights.Normal;
            gg.lblPlayer2.FontWeight = FontWeights.Normal;
            gg.lblPlayer3.FontWeight = FontWeights.Normal;
            gg.lblPlayer4.FontWeight = FontWeights.Normal;
            gg.lblPlayer5.FontWeight = FontWeights.Normal;
            switch (turn.GetPlayer().ID)
            {
            case 0:
                gg.lblPlayer0.FontWeight = FontWeights.Bold;
                break;

            case 1:
                gg.lblPlayer1.FontWeight = FontWeights.Bold;
                break;

            case 2:
                gg.lblPlayer2.FontWeight = FontWeights.Bold;
                break;

            case 3:
                gg.lblPlayer3.FontWeight = FontWeights.Bold;
                break;

            case 4:
                gg.lblPlayer4.FontWeight = FontWeights.Bold;
                break;

            case 5:
                gg.lblPlayer5.FontWeight = FontWeights.Bold;
                break;

            default:
                break;
            }
        }