/// <summary> /// Get tripple from the field /// </summary> /// <param name="col"></param> /// <param name="row"></param> /// <param name="direction"></param> /// <returns></returns> public Tripple GetTripple(int col, int row, TrippleDirection direction) { Tripple tripple = new Tripple(); if (direction == TrippleDirection.horizontal) { if (col >= 8) { return(null); } for (int i = 0; i < 3; i++) { tripple.Examine[i] = GetCell(col + i, row); } } else { if (row >= 8) { return(null); } for (int i = 0; i < 3; i++) { tripple.Examine[i] = GetCell(col, row + i); } } return(tripple); }
/// <summary> /// Update the tripple in the field /// </summary> /// <param name="col"></param> /// <param name="row"></param> /// <param name="direction"></param> /// <param name="number"></param> /// <param name="content"></param> /// <param name="source"></param> public void SetTrippleCell(int col, int row, TrippleDirection direction, Byte number, char content, Cell.CellSource source) { Tripple tripple = GetTripple(col, row, direction); tripple.Examine[number].Content = content; tripple.Examine[number].Source = source; }
public bool CheckTripple(int col, int row, TrippleDirection direction) { Tripple tripple = GetTripple(col, row, direction); if (tripple == null) { return(false); } return(tripple.CountCellContent()); }