예제 #1
0
    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();
        }
    }
예제 #2
0
    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();
    }
예제 #3
0
    //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);
        }
    }