Ejemplo n.º 1
0
        /// <summary>
        /// 更新显示玩家信息
        /// </summary>
        /// <param name="row"></param>
        /// <param name="col"></param>
        private void UpdatePlayerInfo(int row, int col, bool isReset = false, bool init = false)
        {
            Draw.FillRectangle(WhiteBrush, new Rectangle(0, 0, LayoutMap.Width, TitleHeight));
            var p1     = GamePlayers.First() as FiveGamePlayer;
            var p2     = GamePlayers.Last() as FiveGamePlayer;
            int x      = 5;
            int y_one  = 0;
            int offset = 2;
            var Pixel  = this.Pixel - 5;

            Draw.FillEllipse(Brushes[p1.Index - 1], new Rectangle(x, y_one, Pixel, Pixel));
            Draw.DrawString(":" + p1.PlayerNickName, TextFont, BlackBrush, new PointF(x + Pixel + offset, y_one));

            int y = y_one + Pixel + offset;

            Draw.FillEllipse(Brushes[p2.Index - 1], new Rectangle(x, y, Pixel, Pixel));
            Draw.DrawString(":" + p2.PlayerNickName, TextFont, BlackBrush, new PointF(x + Pixel + offset, y));
            if (!init)
            {
                string conent = isReset ? "玩家悔棋!" : "当前玩家:{0}, 下子:[{1},{2}]".Format(DoPlayer.PlayerNickName, row + 1, col + 1);

                Draw.DrawString(conent, TextFont, BlackBrush, new PointF(x, y + this.Pixel + offset));
            }
        }