void GetSelectableIndexes() { if (fieldBox.Count == 0) { selectableIndexes = handCards.IndexListWhere((c) => { return(master.onHeartBreak || c.markNo != (int)MarkName.heart); }).ToArray(); return; } List <int> tempIndexList = handCards.IndexListWhere((c) => { return(c.markNo == fieldBox[0].markNo); }); if (tempIndexList.Count > 0) { selectableIndexes = tempIndexList.ToArray(); } else { selectableIndexes = handCards.IndexListWhere((c) => { return(true); }).ToArray(); } }
void GiveHearts(int winnerIndex) { List <int> givenCardIndexes = fieldCards.IndexListWhere( (c) => { return(c.IsMatch((int)MarkName.spade, 12) || c.markNo == (int)MarkName.heart); }); int givenCnt = givenCardIndexes.Count; for (int i = 0; i < givenCnt; i++) { fieldCards.MoveTo(ref players[winnerIndex].heartBox, givenCardIndexes[i] - i); } players[winnerIndex].heartBox.ListView(); }
//scoreが25でtrue、shoot the moon public bool CalculateScore() { int score = heartBox.CountAll((c) => { return(c.markNo == (int)MarkName.heart); }); if (heartBox.IndexListWhere( (c) => { return(c.IsMatch((int)MarkName.spade, 12)); }).Count > 0) { score += 12; } heartBox.RemoveAll((x) => true); if (score == 25) {//Shoot the moon return(true); } else { AddScore(score); return(false); } }