コード例 #1
0
    void RequestFirstHand(int senderid)
    {
        Log("Player " + senderid + " requesting first hand");

        Player player = match.GetPlayer(senderid);

        List <Card> cards = match.RequestFirstHand(player.id);

        RaiseEventOptions options = new RaiseEventOptions
        {
            TargetActors = new int[] { senderid }
        };

        PhotonNetwork.RaiseEvent(EventCodes.A_FIRST_HAND, MyJson.ToJson(cards), true, options);

        NotifyHandStatus(senderid);
    }
コード例 #2
0
    void BeginTurnDrawCards(int playerId, int[] request)
    {
        if (match.turn.CurrentPlayerId == playerId)
        {
            Log("Player " + playerId + " draws");

            int commonCards    = request[0];
            int spaceshipCards = request[1];

            List <Card> cards = match.StartTurnRequestCards(playerId, commonCards, spaceshipCards);

            RaiseEventOptions options = new RaiseEventOptions
            {
                TargetActors = new int[] { playerId }
            };

            PhotonNetwork.RaiseEvent(EventCodes.A_BEGIN_TURN_DRAW_CARDS, MyJson.ToJson(cards), true, options);
        }
    }
コード例 #3
0
ファイル: Program.cs プロジェクト: seenew/CSharp2020
 static void Main(string[] args)
 {
     MyJson myJson = new MyJson();
     var    foo    = myJson.ToJson();
 }