Пример #1
0
 private List <GoCoord> RemoveBlock(GoBlock block)
 {
     if (block == null || block.DianNumber == 0)
     {
         GoException.Throw("Attempt remove a NULL or EMPTY Block");
     }
     return(block.Remove());
 }
Пример #2
0
 private void OnRemoveChess(GoPoint point)
 {
     if (point.Block != null && point.Block.DianNumber != 0)
     {
         GoBlock block = point.Block;
         block.RemoveDian(point);
         point.Type = GoPointType.EMPTY;
     }
 }
Пример #3
0
 private void Merge(GoBlock block)
 {
     if (block.Type != type_)
     {
         throw new Exception("ERROR: Attempt merge two block under different type");
     }
     foreach (KeyValuePair <int, GoPoint> pair in block.dianMap_)
     {
         if (!dianMap_.ContainsKey(pair.Key))
         {
             dianMap_.Add(pair.Key, pair.Value);
             pair.Value.Block = this;
         }
         else
         {
             throw new Exception("ERROR: Found different blocks have the same dian");
         }
     }
     block.dianMap_.Clear();
 }