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); } } }
protected virtual void OnVisitCell(VisitCellEventArgs e) { if (VisitCell != null) { VisitCell?.Invoke(this, e); } }
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; }
public void VisitCellHandler(object sender, VisitCellEventArgs e) { // do nothing }