Exemplo n.º 1
0
        public override void OnMePassed()
        {
            _myPlayerInfoDisplay.HidePassButton();

            if (State != RoomState.Playing)
            {
                return;
            }

            if (AllCardsCovered)
            {
                //pass
                ClientSendPackets.Send_Pass();
                StaticRoomData.MyPlayer.Pass = true;
            }
            //if i am defending
            else if (MeDefending)
            {
                //pick up cards
                DefenderPassedPriority = true;

                ClientSendPackets.Send_Pass();
                StaticRoomData.MyPlayer.Pass = true;
            }
            //if my turn and i am attacking
            else if (IcanAddCards)
            {
                //pass
                ClientSendPackets.Send_Pass();
                StaticRoomData.MyPlayer.Pass = true;
            }
        }
Exemplo n.º 2
0
        public void Refresh()
        {
            Util.DestroyAllChildren(_roomDisplaysContainer);

            ClientSendPackets.Send_RefreshRoomList();
            //todo animaton until OnRoomList
        }
Exemplo n.º 3
0
 public void OnSubmit()
 {
     if (_betSlider.FloorValue > FoolNetwork.LocalPlayer.Money)
     {
         DialogueManager.Instance.ShowOk("Вам не хватает денег, чтобы сделать такую ставку.");
     }
     else
     {
         ClientSendPackets.Send_CreateRoom(_currMaxPlayers, _currDeckSize, _betSlider.FloorValue); // TODO send bet
     }
 }
Exemplo n.º 4
0
        // WEB CALLBACKS
        #endregion


        ///////////////////////////////////////////////
        // OTHER CALLBACKS
        // (mainly called by InputManager)
        ///////////////////////////////////////////////

        #region OTHER CALLBACKS

        /// <summary>
        /// Called by InputManager when i click 'ready'
        /// </summary>
        public override void OnMeGotReady(bool value)
        {
            StaticRoomData.MyPlayer.IsReady = value;

            if (value)
            {
                ClientSendPackets.Send_GetReady();
            }
            else
            {
                ClientSendPackets.Send_GetNotReady();
            }
        }
Exemplo n.º 5
0
        /// <summary>
        /// Animates covering card on table with held card
        /// </summary>
        protected void CoverThisCardWith(CardRoot cardOnTable, CardRoot heldCard)
        {
            //TODO save action in buffer for in case if server will say no so we can ctrl+z this action
            // Beat it
            AnimateCoverCardBy(cardOnTable, heldCard);

            heldCard.InteractionDisable();

            // add to list
            cardsOnTableCovering.Add(heldCard);
            //Set cards parameters
            cardOnTable.IsCoveredByACard = true;
            cardOnTable.CoveredByCard    = heldCard;


            // Send to server
            ClientSendPackets.Send_CoverCardOnTable(cardOnTable.CardCode, heldCard.CardCode);

            TableUpdated();
        }
Exemplo n.º 6
0
        /// <summary>
        /// Adds card to table from my hand and animates it
        /// </summary>
        protected void MeAddCardToTable(CardRoot heldCard)
        {
            //disable interactions
            heldCard.InteractionDisable();
            //ADD CARD
            cardsOnTable.Add(heldCard);

            //init animation
            AnimateAddCardOnTableFromMyHand(heldCard);

            //TODO save action in buffer for in case if server will say no so we can ctrl+z this action
            //Send to server
            ClientSendPackets.Send_DropCardOnTable(heldCard.CardCode);

            // if my hand is empty then count as pass
            if (StaticRoomData.MyPlayer.CardsNumber == 0 && MeLeadAttack)
            {
                AttackerPassedPriority = true;
            }

            TableUpdated();
        }
Exemplo n.º 7
0
        /// <summary>
        /// On i clicked get ready button
        /// </summary>
        public void OnGetReadyClick(bool value)
        {
            if (State != RoomState.PlayersGettingReady)
            {
                return;
            }

            if (value)
            {
                ClientSendPackets.Send_GetReady();
            }
            else
            {
                ClientSendPackets.Send_GetNotReady();
            }

            StaticRoomData.MyPlayer.IsReady = value;

            if (EverybodyReady)
            {
                WaitForGameStartSignal();
            }
        }
Exemplo n.º 8
0
    public const int PayServerPort = 5056; // todo recieve from server

    public void WithdtawMoney(float sum, string requsites)
    {
        ClientSendPackets.Send_WithdrawFunds(sum, requsites);
    }
Exemplo n.º 9
0
 public void OnSendClick()
 {
     ClientSendPackets.Send_UploadAvatar(_selectedSpriteBytes);
 }