示例#1
0
        public string[] HandRow(string direction)
        {
            string[] handRow = new string[13];
            int      iCard   = 0;

            if (direction == "North")
            {
                for (int i = 0; i < NorthSpades.Length; i++)
                {
                    handRow[iCard] = NorthSpades.Substring(i, 1) + "S";
                    iCard++;
                }
                for (int i = 0; i < NorthHearts.Length; i++)
                {
                    handRow[iCard] = NorthHearts.Substring(i, 1) + "H";
                    iCard++;
                }
                for (int i = 0; i < NorthClubs.Length; i++)
                {
                    handRow[iCard] = NorthClubs.Substring(i, 1) + "C";
                    iCard++;
                }
                for (int i = 0; i < NorthDiamonds.Length; i++)
                {
                    handRow[iCard] = NorthDiamonds.Substring(i, 1) + "D";
                    iCard++;
                }
            }
            else if (direction == "East")
            {
                for (int i = 0; i < EastSpades.Length; i++)
                {
                    handRow[iCard] = EastSpades.Substring(i, 1) + "S";
                    iCard++;
                }
                for (int i = 0; i < EastHearts.Length; i++)
                {
                    handRow[iCard] = EastHearts.Substring(i, 1) + "H";
                    iCard++;
                }
                for (int i = 0; i < EastClubs.Length; i++)
                {
                    handRow[iCard] = EastClubs.Substring(i, 1) + "C";
                    iCard++;
                }
                for (int i = 0; i < EastDiamonds.Length; i++)
                {
                    handRow[iCard] = EastDiamonds.Substring(i, 1) + "D";
                    iCard++;
                }
            }
            else if (direction == "South")
            {
                for (int i = 0; i < SouthSpades.Length; i++)
                {
                    handRow[iCard] = SouthSpades.Substring(i, 1) + "S";
                    iCard++;
                }
                for (int i = 0; i < SouthHearts.Length; i++)
                {
                    handRow[iCard] = SouthHearts.Substring(i, 1) + "H";
                    iCard++;
                }
                for (int i = 0; i < SouthClubs.Length; i++)
                {
                    handRow[iCard] = SouthClubs.Substring(i, 1) + "C";
                    iCard++;
                }
                for (int i = 0; i < SouthDiamonds.Length; i++)
                {
                    handRow[iCard] = SouthDiamonds.Substring(i, 1) + "D";
                    iCard++;
                }
            }
            else if (direction == "West")
            {
                for (int i = 0; i < WestSpades.Length; i++)
                {
                    handRow[iCard] = WestSpades.Substring(i, 1) + "S";
                    iCard++;
                }
                for (int i = 0; i < WestHearts.Length; i++)
                {
                    handRow[iCard] = WestHearts.Substring(i, 1) + "H";
                    iCard++;
                }
                for (int i = 0; i < WestClubs.Length; i++)
                {
                    handRow[iCard] = WestClubs.Substring(i, 1) + "C";
                    iCard++;
                }
                for (int i = 0; i < WestDiamonds.Length; i++)
                {
                    handRow[iCard] = WestDiamonds.Substring(i, 1) + "D";
                    iCard++;
                }
            }
            return(handRow);
        }
示例#2
0
 public string[,] HandTable(int northDirectionNumber, string trumps = "NT")
 {
     string[,] handTable = new string[4, 13];
     for (int iHand = 0; iHand < 4; iHand++)
     {
         int dir   = northDirectionNumber;
         int iCard = 0;
         if (trumps == "NT" || trumps == "S")
         {
             for (int i = 0; i < NorthSpades.Length; i++)
             {
                 handTable[dir, iCard] = NorthSpades.Substring(i, 1) + "S";
                 iCard++;
             }
             for (int i = 0; i < NorthHearts.Length; i++)
             {
                 handTable[dir, iCard] = NorthHearts.Substring(i, 1) + "H";
                 iCard++;
             }
             for (int i = 0; i < NorthClubs.Length; i++)
             {
                 handTable[dir, iCard] = NorthClubs.Substring(i, 1) + "C";
                 iCard++;
             }
             for (int i = 0; i < NorthDiamonds.Length; i++)
             {
                 handTable[dir, iCard] = NorthDiamonds.Substring(i, 1) + "D";
                 iCard++;
             }
         }
         else if (trumps == "H")
         {
             for (int i = 0; i < NorthHearts.Length; i++)
             {
                 handTable[dir, iCard] = NorthHearts.Substring(i, 1) + "H";
                 iCard++;
             }
             for (int i = 0; i < NorthSpades.Length; i++)
             {
                 handTable[dir, iCard] = NorthSpades.Substring(i, 1) + "S";
                 iCard++;
             }
             for (int i = 0; i < NorthDiamonds.Length; i++)
             {
                 handTable[dir, iCard] = NorthDiamonds.Substring(i, 1) + "D";
                 iCard++;
             }
             for (int i = 0; i < NorthClubs.Length; i++)
             {
                 handTable[dir, iCard] = NorthClubs.Substring(i, 1) + "C";
                 iCard++;
             }
         }
         else if (trumps == "D")
         {
             for (int i = 0; i < NorthDiamonds.Length; i++)
             {
                 handTable[dir, iCard] = NorthDiamonds.Substring(i, 1) + "D";
                 iCard++;
             }
             for (int i = 0; i < NorthSpades.Length; i++)
             {
                 handTable[dir, iCard] = NorthSpades.Substring(i, 1) + "S";
                 iCard++;
             }
             for (int i = 0; i < NorthHearts.Length; i++)
             {
                 handTable[dir, iCard] = NorthHearts.Substring(i, 1) + "H";
                 iCard++;
             }
             for (int i = 0; i < NorthClubs.Length; i++)
             {
                 handTable[dir, iCard] = NorthClubs.Substring(i, 1) + "C";
                 iCard++;
             }
         }
         else if (trumps == "C")
         {
             for (int i = 0; i < NorthClubs.Length; i++)
             {
                 handTable[dir, iCard] = NorthClubs.Substring(i, 1) + "C";
                 iCard++;
             }
             for (int i = 0; i < NorthHearts.Length; i++)
             {
                 handTable[dir, iCard] = NorthHearts.Substring(i, 1) + "H";
                 iCard++;
             }
             for (int i = 0; i < NorthSpades.Length; i++)
             {
                 handTable[dir, iCard] = NorthSpades.Substring(i, 1) + "S";
                 iCard++;
             }
             for (int i = 0; i < NorthDiamonds.Length; i++)
             {
                 handTable[dir, iCard] = NorthDiamonds.Substring(i, 1) + "D";
                 iCard++;
             }
         }
         dir   = (dir + 1) % 4; // Change to East
         iCard = 0;
         if (trumps == "NT" || trumps == "S")
         {
             for (int i = 0; i < EastSpades.Length; i++)
             {
                 handTable[dir, iCard] = EastSpades.Substring(i, 1) + "S";
                 iCard++;
             }
             for (int i = 0; i < EastHearts.Length; i++)
             {
                 handTable[dir, iCard] = EastHearts.Substring(i, 1) + "H";
                 iCard++;
             }
             for (int i = 0; i < EastClubs.Length; i++)
             {
                 handTable[dir, iCard] = EastClubs.Substring(i, 1) + "C";
                 iCard++;
             }
             for (int i = 0; i < EastDiamonds.Length; i++)
             {
                 handTable[dir, iCard] = EastDiamonds.Substring(i, 1) + "D";
                 iCard++;
             }
         }
         else if (trumps == "H")
         {
             for (int i = 0; i < EastHearts.Length; i++)
             {
                 handTable[dir, iCard] = EastHearts.Substring(i, 1) + "H";
                 iCard++;
             }
             for (int i = 0; i < EastSpades.Length; i++)
             {
                 handTable[dir, iCard] = EastSpades.Substring(i, 1) + "S";
                 iCard++;
             }
             for (int i = 0; i < EastDiamonds.Length; i++)
             {
                 handTable[dir, iCard] = EastDiamonds.Substring(i, 1) + "D";
                 iCard++;
             }
             for (int i = 0; i < EastClubs.Length; i++)
             {
                 handTable[dir, iCard] = EastClubs.Substring(i, 1) + "C";
                 iCard++;
             }
         }
         else if (trumps == "D")
         {
             for (int i = 0; i < EastDiamonds.Length; i++)
             {
                 handTable[dir, iCard] = EastDiamonds.Substring(i, 1) + "D";
                 iCard++;
             }
             for (int i = 0; i < EastSpades.Length; i++)
             {
                 handTable[dir, iCard] = EastSpades.Substring(i, 1) + "S";
                 iCard++;
             }
             for (int i = 0; i < EastHearts.Length; i++)
             {
                 handTable[dir, iCard] = EastHearts.Substring(i, 1) + "H";
                 iCard++;
             }
             for (int i = 0; i < EastClubs.Length; i++)
             {
                 handTable[dir, iCard] = EastClubs.Substring(i, 1) + "C";
                 iCard++;
             }
         }
         else if (trumps == "C")
         {
             for (int i = 0; i < EastClubs.Length; i++)
             {
                 handTable[dir, iCard] = EastClubs.Substring(i, 1) + "C";
                 iCard++;
             }
             for (int i = 0; i < EastHearts.Length; i++)
             {
                 handTable[dir, iCard] = EastHearts.Substring(i, 1) + "H";
                 iCard++;
             }
             for (int i = 0; i < EastSpades.Length; i++)
             {
                 handTable[dir, iCard] = EastSpades.Substring(i, 1) + "S";
                 iCard++;
             }
             for (int i = 0; i < EastDiamonds.Length; i++)
             {
                 handTable[dir, iCard] = EastDiamonds.Substring(i, 1) + "D";
                 iCard++;
             }
         }
         dir   = (dir + 1) % 4; // Change to South
         iCard = 0;
         if (trumps == "NT" || trumps == "S")
         {
             for (int i = 0; i < SouthSpades.Length; i++)
             {
                 handTable[dir, iCard] = SouthSpades.Substring(i, 1) + "S";
                 iCard++;
             }
             for (int i = 0; i < SouthHearts.Length; i++)
             {
                 handTable[dir, iCard] = SouthHearts.Substring(i, 1) + "H";
                 iCard++;
             }
             for (int i = 0; i < SouthClubs.Length; i++)
             {
                 handTable[dir, iCard] = SouthClubs.Substring(i, 1) + "C";
                 iCard++;
             }
             for (int i = 0; i < SouthDiamonds.Length; i++)
             {
                 handTable[dir, iCard] = SouthDiamonds.Substring(i, 1) + "D";
                 iCard++;
             }
         }
         else if (trumps == "H")
         {
             for (int i = 0; i < SouthHearts.Length; i++)
             {
                 handTable[dir, iCard] = SouthHearts.Substring(i, 1) + "H";
                 iCard++;
             }
             for (int i = 0; i < SouthSpades.Length; i++)
             {
                 handTable[dir, iCard] = SouthSpades.Substring(i, 1) + "S";
                 iCard++;
             }
             for (int i = 0; i < SouthDiamonds.Length; i++)
             {
                 handTable[dir, iCard] = SouthDiamonds.Substring(i, 1) + "D";
                 iCard++;
             }
             for (int i = 0; i < SouthClubs.Length; i++)
             {
                 handTable[dir, iCard] = SouthClubs.Substring(i, 1) + "C";
                 iCard++;
             }
         }
         else if (trumps == "D")
         {
             for (int i = 0; i < SouthDiamonds.Length; i++)
             {
                 handTable[dir, iCard] = SouthDiamonds.Substring(i, 1) + "D";
                 iCard++;
             }
             for (int i = 0; i < SouthSpades.Length; i++)
             {
                 handTable[dir, iCard] = SouthSpades.Substring(i, 1) + "S";
                 iCard++;
             }
             for (int i = 0; i < SouthHearts.Length; i++)
             {
                 handTable[dir, iCard] = SouthHearts.Substring(i, 1) + "H";
                 iCard++;
             }
             for (int i = 0; i < SouthClubs.Length; i++)
             {
                 handTable[dir, iCard] = SouthClubs.Substring(i, 1) + "C";
                 iCard++;
             }
         }
         else if (trumps == "C")
         {
             for (int i = 0; i < SouthClubs.Length; i++)
             {
                 handTable[dir, iCard] = SouthClubs.Substring(i, 1) + "C";
                 iCard++;
             }
             for (int i = 0; i < SouthHearts.Length; i++)
             {
                 handTable[dir, iCard] = SouthHearts.Substring(i, 1) + "H";
                 iCard++;
             }
             for (int i = 0; i < SouthSpades.Length; i++)
             {
                 handTable[dir, iCard] = SouthSpades.Substring(i, 1) + "S";
                 iCard++;
             }
             for (int i = 0; i < SouthDiamonds.Length; i++)
             {
                 handTable[dir, iCard] = SouthDiamonds.Substring(i, 1) + "D";
                 iCard++;
             }
         }
         dir   = (dir + 1) % 4; // Change to West
         iCard = 0;
         if (trumps == "NT" || trumps == "S")
         {
             for (int i = 0; i < WestSpades.Length; i++)
             {
                 handTable[dir, iCard] = WestSpades.Substring(i, 1) + "S";
                 iCard++;
             }
             for (int i = 0; i < WestHearts.Length; i++)
             {
                 handTable[dir, iCard] = WestHearts.Substring(i, 1) + "H";
                 iCard++;
             }
             for (int i = 0; i < WestClubs.Length; i++)
             {
                 handTable[dir, iCard] = WestClubs.Substring(i, 1) + "C";
                 iCard++;
             }
             for (int i = 0; i < WestDiamonds.Length; i++)
             {
                 handTable[dir, iCard] = WestDiamonds.Substring(i, 1) + "D";
                 iCard++;
             }
         }
         else if (trumps == "H")
         {
             for (int i = 0; i < WestHearts.Length; i++)
             {
                 handTable[dir, iCard] = WestHearts.Substring(i, 1) + "H";
                 iCard++;
             }
             for (int i = 0; i < WestSpades.Length; i++)
             {
                 handTable[dir, iCard] = WestSpades.Substring(i, 1) + "S";
                 iCard++;
             }
             for (int i = 0; i < WestDiamonds.Length; i++)
             {
                 handTable[dir, iCard] = WestDiamonds.Substring(i, 1) + "D";
                 iCard++;
             }
             for (int i = 0; i < WestClubs.Length; i++)
             {
                 handTable[dir, iCard] = WestClubs.Substring(i, 1) + "C";
                 iCard++;
             }
         }
         else if (trumps == "D")
         {
             for (int i = 0; i < WestDiamonds.Length; i++)
             {
                 handTable[dir, iCard] = WestDiamonds.Substring(i, 1) + "D";
                 iCard++;
             }
             for (int i = 0; i < WestSpades.Length; i++)
             {
                 handTable[dir, iCard] = WestSpades.Substring(i, 1) + "S";
                 iCard++;
             }
             for (int i = 0; i < WestHearts.Length; i++)
             {
                 handTable[dir, iCard] = WestHearts.Substring(i, 1) + "H";
                 iCard++;
             }
             for (int i = 0; i < WestClubs.Length; i++)
             {
                 handTable[dir, iCard] = WestClubs.Substring(i, 1) + "C";
                 iCard++;
             }
         }
         else if (trumps == "C")
         {
             for (int i = 0; i < WestClubs.Length; i++)
             {
                 handTable[dir, iCard] = WestClubs.Substring(i, 1) + "C";
                 iCard++;
             }
             for (int i = 0; i < WestHearts.Length; i++)
             {
                 handTable[dir, iCard] = WestHearts.Substring(i, 1) + "H";
                 iCard++;
             }
             for (int i = 0; i < WestSpades.Length; i++)
             {
                 handTable[dir, iCard] = WestSpades.Substring(i, 1) + "S";
                 iCard++;
             }
             for (int i = 0; i < WestDiamonds.Length; i++)
             {
                 handTable[dir, iCard] = WestDiamonds.Substring(i, 1) + "D";
                 iCard++;
             }
         }
     }
     return(handTable);
 }