示例#1
0
 public void Add(DamkaBoard board, bool turn, int depth, int score)
 {
     byte[] key = board.GetByteArray(turn);
     if (!this.dictionary.ContainsKey(key))
     {
         try
         {
             this.dictionary.Add(key, new int[2] {
                 depth, score
             });
         }
         catch
         {
             return;
         }
     }
 }
示例#2
0
 public int[] Check(DamkaBoard board, bool turn, int depth)
 {
     byte[] key = board.GetByteArray(turn);
     if (this.dictionary.ContainsKey(key))
     {
         int[] results = (int[])(this.dictionary[key]);
         if (depth > results[0])
         {
             return(new int[2] {
                 -20, 0
             });
         }
         return(results);
     }
     return(new int[2] {
         -15, 0
     });
 }
示例#3
0
 public void Update(DamkaBoard board, bool turn, int depth, int score)
 {
     this.dictionary[board.GetByteArray(turn)] = new int[2] {
         depth, score
     };
 }