Example #1
0
        private Ghor GetQuadrantGhor(int position)
        {
            Ghor ghor = this.Quadrant.GetGhorByPosition(position);

            ghor.UIControl.Anchor = ((AnchorStyles)((((AnchorStyles.Top | AnchorStyles.Bottom)
                                                      | AnchorStyles.Left) | AnchorStyles.Right)));
            if (position == 1 || position >= 13)
            {
                ghor.UIControl.BackColor = Utils.Util.GetDrawingColor(Color);
            }
            else
            {
                ghor.UIControl.BackColor = System.Drawing.Color.White;
            }
            ghor.UIControl.Margin = new System.Windows.Forms.Padding(0);
            ghor.UIControl.Size   = new System.Drawing.Size(49, 49);

            Label label = new System.Windows.Forms.Label();

            label.AutoSize = true;
            label.Location = new System.Drawing.Point(18, 18);
            label.Text     = ghor.Position.ToString();

            ghor.UIControl.Controls.Add(label);

            return(ghor);
        }
Example #2
0
 public void ShowTransitions(Piece piece)
 {
     foreach (GameBoardPosition position in piece.TransitionPositions)
     {
         Ghor ghor = position.Ghor;
         ghor.UIControl.Controls.Add(piece.UIControl);
         piece.UIControl.BringToFront();
     }
 }
Example #3
0
        public GameBoardPosition GetNextGhor(GameBoardPosition gameBoardPosition, Player player)
        {
            if (gameBoardPosition != null)
            {
                Ghor     ghor     = gameBoardPosition.Ghor;
                Quadrant quadrant = gameBoardPosition.Quadrant;

                if (ghor != null && ghor.Position == 18)
                {
                    return(null);
                }
                else if (ghor.GhorType == GhorType.Home)
                {
                    // Move to Home Star
                    gameBoardPosition.Ghor = quadrant.GhorPath[1];
                }
                else if (ghor.Position == 11)
                {
                    //Move to Next Quadrant
                    gameBoardPosition.Quadrant = this.GetNextQuadrant(quadrant);
                    gameBoardPosition.Ghor     = gameBoardPosition.Quadrant.GhorPath[12];
                }
                else if (ghor.Position == 12)
                {
                    if (gameBoardPosition.Quadrant.Color == player.Color)
                    {
                        // Move to Final Line
                        gameBoardPosition.Ghor = gameBoardPosition.Quadrant.GhorPath[13];
                    }
                    else
                    {
                        gameBoardPosition.Ghor = gameBoardPosition.Quadrant.GhorPath[0];
                    }
                }
                else if (ghor == quadrant.GetLastGhor())
                {
                    // Matured
                    gameBoardPosition.Ghor = new Ghor(18);
                }
                else
                {
                    // Proceed One ghor
                    gameBoardPosition.Ghor = quadrant.GhorPath[ghor.Position + 1];
                }

                return(gameBoardPosition);
            }
            else
            {
                return(null);
            }
        }
Example #4
0
 public GameBoardPosition(Quadrant quadrant, Ghor ghor)
 {
     Quadrant = quadrant;
     Ghor     = ghor;
 }