示例#1
0
 public void VisitCellHandler(object sender, VisitCellEventArgs e)
 {
     if (e.cell.Piece.NumPieces == 2)
     {
         if (e.cell.Piece.Color == PieceColor.White)
         {
             _whiteGipfs.Add(e.cell.hex);
         }
         else
         {
             _blackGipfs.Add(e.cell.hex);
         }
     }
     else if (e.cell.Piece.NumPieces == 1)
     {
         if (e.cell.Piece.Color == PieceColor.White)
         {
             _whiteNonGipfs.Add(e.cell.hex);
         }
         else
         {
             _blackNonGipfs.Add(e.cell.hex);
         }
     }
 }
示例#2
0
 protected virtual void OnVisitCell(VisitCellEventArgs e)
 {
     if (VisitCell != null)
     {
         VisitCell?.Invoke(this, e);
     }
 }
示例#3
0
 public void VisitCellHandler(object sender, VisitCellEventArgs e)
 {
     if (e.cell.Piece.Color != _lastPiece.Color || e.newLine)
     {
         if (null == _currentRun)
         {
             _currentRun = new List <Cell>();
             _currentRun.Add(e.cell);
         }
         else
         {
             _runs.Add(new CellRun(_currentRun));
             _currentRun.Clear();
             _currentRun.Add(e.cell);
         }
     }
     else
     {
         _currentRun.Add(e.cell);
     }
     _lastPiece = e.cell.Piece;
 }
示例#4
0
 public void VisitCellHandler(object sender, VisitCellEventArgs e)
 {
     // do nothing
 }