Exemple #1
0
        private bool IsCamelLandEmptyCase(byte aCamel)
        {
            byte[] rank = GetRank();
            aCamel = GameRules.ByteRollToUnroll(aCamel);
            for (int i = 1; i < rank.Length; i++)
            {
                if (GameRules.ByteRollToUnroll(rank[i]) == aCamel)
                {
                    return(GetCamelPos(aCamel) != GetCamelPos(rank[i - 1]));
                }
            }

            return(true);
        }
Exemple #2
0
        private void SetAllCamelUnroll()
        {
            byte[] tempBoard = new byte[BoardState.Length];
            for (int i = 0; i < tempBoard.Length; i++)
            {
                if (GameRules.IsByteIdentityCamel(BoardState[i]))
                {
                    tempBoard[i] = GameRules.ByteRollToUnroll(BoardState[i]);
                }
                else
                {
                    tempBoard[i] = BoardState[i];
                }
            }

            BoardState = tempBoard;
        }
Exemple #3
0
 private int GetCamelPos(byte aRolledCamel)
 {
     if (!m_Position.ContainsKey(aRolledCamel))
     {
         int retval = 0;
         foreach (byte token in BoardState)
         {
             if (GameRules.IsByteIdentityCamel(token) && GameRules.ByteRollToUnroll(token) == GameRules.ByteRollToUnroll(aRolledCamel))
             {
                 m_Position.Add(aRolledCamel, retval);
             }
             else if (token == GameRules.CASE_SEPARATOR_BYTE)
             {
                 retval++;
             }
         }
     }
     return(m_Position[aRolledCamel]);
 }