public int tempValue() { if (temp != null) { return(temp.getValue()); } return(-1); }
public int[] getLimits(int index, bool targetColor) { int[] limits = { 0, 14 }; if (index > 0) { for (int i = index - 1; i >= 0; i--) { CardS t = getCard(i); if (t.getVisible()) { if (t.getColor() == targetColor) { limits[0] = t.getValue() + 1; } else { limits[0] = t.getValue(); } break; } } } if (index < cards.Count - 1) { for (int i = index + 1; i < cards.Count; i++) { CardS t = getCard(i); if (t.getVisible()) { if (t.getColor() == targetColor) { limits[1] = t.getValue(); } else { limits[1] = t.getValue() + 1; } break; } } } return(limits); }