protected virtual void OnGameStarted() { gameDataManager = new GameDataManager(localPlayer, remotePlayer); gameDataManager.Shuffle(); gameDataManager.DealCardValuesToPlayer(localPlayer, Constants.PLAYER_INITIAL_CARDS); gameDataManager.DealCardValuesToPlayer(remotePlayer, Constants.PLAYER_INITIAL_CARDS); cardAnimator.DealDisplayingCards(localPlayer, Constants.PLAYER_INITIAL_CARDS); cardAnimator.DealDisplayingCards(remotePlayer, Constants.PLAYER_INITIAL_CARDS); }
protected virtual void OnGameStarted() { gameDataManager = new GameDataManager(localPlayer, remotePlayer); gameDataManager.Shuffle(); //PLAY SOUND audioData.PlayOneShot(shuffleClip); //audioData.clip = shuffleClip; //audioData.loop = true; //audioData.Play(); for (int i = 0; i < 3; i++) { byte bookRankP1 = gameDataManager.DrawCardValue(); byte bookRankP2 = gameDataManager.DrawCardValue(); //cardAnimator.DealBooks(localPlayer, bookRankP1); //cardAnimator.DealBooks(remotePlayer, bookRankP2); remotePlayer.CreateBottomBook(bookRankP1, cardAnimator, i); localPlayer.CreateBottomBook(bookRankP2, cardAnimator, i); gameDataManager.AddBottomBooksForPlayer(localPlayer, Card.GetRank(bookRankP1)); gameDataManager.AddBottomBooksForPlayer(remotePlayer, Card.GetRank(bookRankP2)); } for (int i = 0; i < 3; i++) { byte bookRankP1 = gameDataManager.DrawCardValue(); byte bookRankP2 = gameDataManager.DrawCardValue(); remotePlayer.CreateTopBook(bookRankP1, cardAnimator, i); localPlayer.CreateTopBook(bookRankP2, cardAnimator, i); //localPlayer.ReceiveBook(bookRankP1, cardAnimator); gameDataManager.AddBooksForPlayer(localPlayer, Card.GetRank(bookRankP1)); gameDataManager.AddBooksForPlayer(remotePlayer, Card.GetRank(bookRankP2)); } for (int i = 0; i < 3; i++) { gameDataManager.DealCardValuesToPlayer(localPlayer, PLAYER_INITIAL_2_CARDS); gameDataManager.DealCardValuesToPlayer(remotePlayer, PLAYER_INITIAL_2_CARDS); cardAnimator.DealDisplayingCards(localPlayer, PLAYER_INITIAL_2_CARDS); cardAnimator.DealDisplayingCards(remotePlayer, PLAYER_INITIAL_2_CARDS); } //audioData.loop = false; //audioData.Stop(); gameState = GameState.TurnStarted; }
protected virtual void OnGameStarted() { gameDataManager = new GameDataManager(localPlayer, remotePlayer); //Stack.text = localPlayer.StackAmt.ToString(); gameDataManager.Shuffle(); gameDataManager.DealCardValuesToPlayer(localPlayer, Constants.PLAYER_INITIAL_CARDS); gameDataManager.DealCardValuesToPlayer(remotePlayer, Constants.PLAYER_INITIAL_CARDS); cardAnimator.DealDisplayingCards(localPlayer, Constants.PLAYER_INITIAL_CARDS); cardAnimator.DealDisplayingCards(remotePlayer, Constants.PLAYER_INITIAL_CARDS); gameState = GameState.TurnStarted; }
void OnGameStarted() { if (PhotonNetwork.IsMasterClient) { leastCountManager.Shuffle(); List <byte> player1Values = leastCountManager.DealCardValuesToPlayer(localPlayer, Constants.PLAYER_INITIAL_CARDS); List <byte> player2Values = leastCountManager.DealCardValuesToPlayer(remotePlayer, Constants.PLAYER_INITIAL_CARDS); List <byte> poolOfCards = leastCountManager.GetPoolOfCards(); byte droppedCardValue = leastCountManager.FirstDroppedCard(); List <byte> droppedListValue = new List <byte>(); droppedListValue.Add(droppedCardValue); Dictionary <string, byte[]> dict = new Dictionary <string, byte[]>(); dict.Add(localPlayer.PlayerId, player1Values.ToArray()); dict.Add(remotePlayer.PlayerId, player2Values.ToArray()); dict.Add("poolOfCards", poolOfCards.ToArray()); dict.Add(Constants.INITIALIZING_DROPPEDCARD, droppedListValue.ToArray()); currentTurnPlayer = localPlayer; //Hashtable props = new Hashtable //{ //{Constants.INITIALIZING_CARDS, dict} //}; //PhotonNetwork.CurrentRoom.SetCustomProperties(props); byte evCode = 1; // Custom Event 1: Used as "MoveUnitsToTargetPosition" event //object[] content = new object[] { dict }; // Array contains the target position and the IDs of the selected units RaiseEventOptions raiseEventOptions = new RaiseEventOptions { Receivers = ReceiverGroup.All }; // You would have to set the Receivers to All in order to receive this event on the local client as well PhotonNetwork.RaiseEvent(evCode, dict, raiseEventOptions, SendOptions.SendReliable); Debug.Log("master onstarted"); cardAnimator.DealDisplayingCards(localPlayer, Constants.PLAYER_INITIAL_CARDS); cardAnimator.DealDisplayingCards(remotePlayer, Constants.PLAYER_INITIAL_CARDS); Card firstDroppedCard = cardAnimator.DropFirstCard(droppedCardValue); leastCountManager.AddToDropCardsReference(firstDroppedCard); } else { if (intializing && !PhotonNetwork.IsMasterClient) { cardAnimator.DealDisplayingCards(localPlayer, Constants.PLAYER_INITIAL_CARDS); cardAnimator.DealDisplayingCards(remotePlayer, Constants.PLAYER_INITIAL_CARDS); Card firstDroppedCard = cardAnimator.DropFirstCard(leastCountManager.GetDroppedCardValues()[0]); leastCountManager.AddToDropCardsReference(firstDroppedCard); intializing = false; } } }
protected virtual void OnGameStarted() { gameDataManager = new GameDataManager(localPlayer, remotePlayer[0], remotePlayer[1], remotePlayer[2]); //mozda redundantno gameDataManager.Shuffle(); gameDataManager.DealCardValuesToPlayer(localPlayer, Constants.PLAYER_INITIAL_CARDS); gameDataManager.DealCardValuesToPlayer(remotePlayer[0], Constants.PLAYER_INITIAL_CARDS); gameDataManager.DealCardValuesToPlayer(remotePlayer[1], Constants.PLAYER_INITIAL_CARDS); gameDataManager.DealCardValuesToPlayer(remotePlayer[2], Constants.PLAYER_INITIAL_CARDS); cardAnimator.DealDisplayingCards(localPlayer, Constants.PLAYER_INITIAL_CARDS); cardAnimator.DealDisplayingCards(remotePlayer[0], Constants.PLAYER_INITIAL_CARDS); cardAnimator.DealDisplayingCards(remotePlayer[1], Constants.PLAYER_INITIAL_CARDS); cardAnimator.DealDisplayingCards(remotePlayer[2], Constants.PLAYER_INITIAL_CARDS); gameState = GameState.TurnStarted; }