コード例 #1
0
ファイル: ServerSystem.cs プロジェクト: Rakiah/Poker
    public void ReturnCards(DistributeType type, DistributeTarget target, int optPlayer)
    {
        List <Player> modifiedList = new List <Player>(Players);

        if (target == DistributeTarget.Exclude)
        {
            modifiedList.RemoveAt(optPlayer);
        }
        else if (target == DistributeTarget.Include)
        {
            modifiedList.Clear(); modifiedList.Add(Players[optPlayer]);
        }

        for (int i = 0; i < modifiedList.Count; i++)
        {
            if (modifiedList[i].isDisconnected)
            {
                continue;
            }
            CoroutinesLauncher.Coroutines.networkView.RPC("ReturnCards",
                                                          modifiedList[i].player,
                                                          optPlayer,
                                                          type == DistributeType.Shown ? true : false);
        }
    }
コード例 #2
0
ファイル: ServerSystem.cs プロジェクト: Rakiah/Poker
    public void Distribute(DistributeType type,
                           DistributeTarget target,
                           int optPlayer,
                           bool returned,
                           Cards toDeal = null,
                           int position = 0)
    {
        List <Player> modifiedList = new List <Player>(Players);

        if (target == DistributeTarget.Exclude)
        {
            modifiedList.RemoveAt(optPlayer);
        }
        else if (target == DistributeTarget.Include)
        {
            modifiedList.Clear();
            modifiedList.Add(Players[optPlayer]);
        }

        for (int i = 0; i < modifiedList.Count; i++)
        {
            if (modifiedList[i].isDisconnected)
            {
                continue;
            }
            if (type == DistributeType.Hidden)
            {
                CoroutinesLauncher.Coroutines.networkView.RPC("DistributeFakeCard",
                                                              modifiedList[i].player,
                                                              optPlayer,
                                                              position,
                                                              returned);
            }
            else
            {
                CoroutinesLauncher.Coroutines.networkView.RPC("DistributeRealCard",
                                                              modifiedList[i].player,
                                                              optPlayer,
                                                              toDeal.Rank,
                                                              (int)toDeal.type, position,
                                                              returned);
            }
        }
    }