Ejemplo n.º 1
0
        public void Start()
        {
            pokerRules = GetComponent <PokerRules>();

            //players = new PokerPlayer[playerNum];
            //for (int i = 0; i < playerNum; ++i)
            //{
            //	GameObject pgo = Instantiate(playerPrefab);
            //	pgo.name = "Player " + (i + 1);
            //	PokerPlayer player = pgo.GetComponent<PokerPlayer>();
            //	players[i] = player;

            //	GameObject handPanelgo = Instantiate(playerHandPrefab, handHolder.transform);
            //	player.handPanel = handPanelgo.GetComponent<HandVisualizer>();
            //}
        }
Ejemplo n.º 2
0
        private void ShowDown()
        {
            if (activePlayers.Count == 1)
            {
                Winner(activePlayers[0]);
            }
            else
            {
                var winners = PokerRules.DetermineWinner(activePlayers);
                if (winners.Count != 1)
                {
                    Debug.Log("We have a tie game!");
                    SplitWinnings(winners);
                }
                else
                {
                    Winner(winners[0]);
                }
            }

            dealButton.SetActive(true);
        }