Exemplo n.º 1
0
 void OnAllReceiveMessageEvent(AllReceiveMessageEvent e)
 {
     if (e.id == "SetBeanPot")
     {
         SetBeanPot(e.val);
     }
 }
Exemplo n.º 2
0
 void OnAllReceiveMessageEvent(AllReceiveMessageEvent e)
 {
     if (e.id == "New Decider")
     {
         Events.instance.Raise(new SelectDeciderEvent(e.message1));
     }
 }
Exemplo n.º 3
0
    protected override void OnAllReceiveMessageEvent(AllReceiveMessageEvent e)
    {
        if (!ThisScreen)
        {
            return;
        }

        if (e.id == "YesAddTime" && !Timer.instance.CountingDown)
        {
            if (!Player.instance.IsDecider)
            {
                MessageMatcher.instance.RemoveMessage("NoAddTime");
            }
            if (Player.instance.IsDecider)
            {
                timer.Interactable = false;
                Timer.instance.AllAddSeconds(TimerValues.extraTime);
                MessageSender.instance.SendMessageToAll("AcceptAddTime", e.message1);
            }
        }

        if (e.id == "AcceptAddTime")
        {
            if (e.message1 == Player.instance.Name)
            {
                Player.instance.MyBeanPool.OnAddTime();
            }
        }
    }
Exemplo n.º 4
0
 void OnAllReceiveMessageEvent(AllReceiveMessageEvent e)
 {
     if (e.id == "UpdatePlayerScore")
     {
         UpdatePlayerScore(e.message1, e.val);
     }
 }
Exemplo n.º 5
0
    /**
     *	Events
     */

    void OnAllReceiveMessageEvent(AllReceiveMessageEvent e)
    {
        if (e.id == "OnDisconnectedFromServer")
        {
            OnDisconnectedFromServer();
        }
    }
Exemplo n.º 6
0
 void OnAllReceiveMessageEvent(AllReceiveMessageEvent e)
 {
     if (e.id == "Winning Player")
     {
         Player.instance.WinningPlayer = e.message1;
     }
 }
Exemplo n.º 7
0
 void OnAllReceiveMessageEvent(AllReceiveMessageEvent e)
 {
     if (e.id == "RaiseMessagesMatch")
     {
         RaiseMessagesMatch(e.message1, e.message2);
     }
 }
Exemplo n.º 8
0
    void OnAllReceiveMessage(AllReceiveMessageEvent e)
    {
        switch (e.id)
        {
        case "ReceiveVotableItems": ReceiveVotableItems(e.message1, e.message2, e.val); break;

        case "ReceiveWinningAgendaItem": ReceiveWinningAgendaItem(e.message1, e.message2); break;
        }
    }
Exemplo n.º 9
0
    // TODO: call this w/o using the event

    /*void OnEnterNameEvent (EnterNameEvent e) {
     *      if (e.name == "#Wade") {
     *              cakeUnlocked = true;
     *              GetLocalDeckNames ();
     *              GetHostedDeckNames ();
     *      }
     * }*/

    void OnAllReceiveMessageEvent(AllReceiveMessageEvent e)
    {
        if (e.id == "OnServerLoadDeck" &&
            e.message1 != "" &&
            !MultiplayerManager.instance.Hosting)
        {
            LoadDeck(e.message1, e.val == 1);
        }
    }
Exemplo n.º 10
0
 void OnAllReceiveMessageEvent(AllReceiveMessageEvent e)
 {
     /*if (e.id == "OnServerLoadDeck") {
      *      if (DeciderSelectionStyle.Host) {
      *              GotoScreen ("Scoreboard", "Round");
      *      } else {
      *              GotoScreen ("Choose Decider", "Decider");
      *      }
      * }*/
 }
Exemplo n.º 11
0
    void OnAllReceiveMessageEvent(AllReceiveMessageEvent e)
    {
        if (e.id != "FinishReceivingWins")
        {
            return;
        }

        winningItems = AgendaItemsManager.instance.WinningItems;
        Update();
    }
Exemplo n.º 12
0
 void OnAllReceiveMessageEvent(AllReceiveMessageEvent e)
 {
     if (e.id == "AssignRole")
     {
         if (e.message1 == Player.instance.Name)
         {
             Events.instance.Raise(new SetRoleEvent(deck.Roles[e.val]));
         }
     }
 }
Exemplo n.º 13
0
 void OnAllReceiveMessageEvent(AllReceiveMessageEvent e)
 {
     if (e.id == "UpdateAgendaItems")
     {
         UpdateAgendaItems();
     }
     else if (e.id == "SendVotableItems")
     {
         SendVotableItems();
     }
 }
Exemplo n.º 14
0
 void OnAllReceiveMessageEvent(AllReceiveMessageEvent e)
 {
     if (e.id == "ReceiveAddSeconds")
     {
         ReceiveAddSeconds(float.Parse(e.message1));
     }
     else if (e.id == "ReceiveCountDown")
     {
         ReceiveCountDown(float.Parse(e.message1));
     }
 }
Exemplo n.º 15
0
 void OnAllReceiveMessageEvent(AllReceiveMessageEvent e)
 {
     if (e.id == "SetHost")
     {
         hostId = e.message1;                // cache host
     }
     else if (e.id == "SetDecider")
     {
         deciderId = e.message1;             // cache decider
     }
     else if (e.id == "RequestClientConfirmation" && !MultiplayerManager.instance.Hosting)
     {
         SendMessageToHost("ConfirmClientReceived", e.message1);
     }
 }
    void OnAllReceiveMessageEvent(AllReceiveMessageEvent e)
    {
        switch (e.id)
        {
        // Wifi
        case "OnSendPlayersToNextScreen": OnSendPlayersToNextScreen(); break;

        case "OnSendPlayersToScreen": OnSendPlayersToScreen(e.message1, e.message2); break;

        // Bluetooth
        case "OnGotoNextScreen": OnSendPlayersToNextScreen(); break;

        case "OnGotoScreen": OnSendPlayersToScreen(e.message1, e.message2); break;
        }
    }
Exemplo n.º 17
0
    void OnAllReceiveMessageEvent(AllReceiveMessageEvent e)
    {
        switch (e.id)
        {
        case "AcceptPlayer": AcceptPlayer(e.message1); break;

        case "RejectPlayer": RejectPlayer(e.message1); break;

        case "ClearPlayerList": ClearPlayerList(); break;

        case "AddPlayer": AddPlayer(e.message1); break;

        case "ListRefreshed": RaiseRefreshPlayerList(); break;
        }
    }
Exemplo n.º 18
0
 protected virtual void OnAllReceiveMessageEvent(AllReceiveMessageEvent e)
 {
 }
Exemplo n.º 19
0
    protected override void OnAllReceiveMessageEvent(AllReceiveMessageEvent e)
    {
        if (!ThisScreen)
        {
            return;
        }

        if (e.id == "UpdatePitcher")
        {
            pitching = (e.message1 == Player.instance.Name);
            if (!Player.instance.IsDecider)
            {
                currentPlayer = e.val;
            }
        }

        if (e.id == "YesAddTime" && !Timer.instance.CountingDown)
        {
            if (Player.instance.IsDecider)
            {
                timer.Interactable = false;
                Timer.instance.AllAddSeconds(TimerValues.extraTime);
                MessageSender.instance.SendMessageToAll("AcceptAddTime", e.message1);
            }
        }

        if (e.id == "NoAddTime")
        {
            if (Player.instance.IsDecider)
            {
                if (currentPlayer >= players.Count - 1)
                {
                    ScreenElements.Enable("next");
                    ScreenElements.Enable("timesUp");
                    ScreenElements.Get <LabelElement> ("timesUp").Content = Copy.PitchTimeDecider2;
                    MessageSender.instance.SendMessageToAll("FinishedPitchingPlayers");
                }
                else
                {
                    ScreenElements.Get <LabelElement> ("topLabel").Content = Copy.PitchInstructions(NextPlayer);
                    timer.Interactable = true;
                    MessageSender.instance.SendMessageToAll("NextPitchingPlayer", NextPlayer);
                }
            }
        }

        if (e.id == "AcceptAddTime")
        {
            if (e.message1 == Player.instance.Name)
            {
                Player.instance.MyBeanPool.OnAddTime();
            }
        }

        if (e.id == "NextPitchingPlayer")
        {
            if (Player.instance.IsDecider)
            {
                return;
            }
            string nextPlayer = e.message1;
            if (nextPlayer == Player.instance.Name)
            {
                pitcherLabel.Content = "Your turn!";
            }
            else
            {
                pitcherLabel.Content = string.Format("{0}'s turn", nextPlayer);
            }
        }

        if (e.id == "FinishedPitchingPlayers")
        {
            if (Player.instance.IsDecider)
            {
                return;
            }
            pitcherLabel.Content = "";
        }
    }