Ejemplo n.º 1
0
        public void setUp()
        {
            ICollection <Player> playerList = ClientDataStore.Instance.Players;

            foreach (Player player in playerList)
            {
                NineGridRow row        = scoreboard.addRow(player.ID.ToString());
                NineCell    playerCell = row.getCell("player");
                string      nameText   = player.Name;
                if (nameText.Length > 12)
                {
                    nameText = nameText.Substring(0, 10) + "...";
                }
                playerCell.Text   = nameText;
                playerCell.Colour = ColourHelper.getPlayerColour(player.ID, playerList.Count);
                NineCell scoreCell = row.getCell("score");
                scoreCell.Text      = "0";
                scoreCell.Alignment = 'C';
                NineCell bidCell = row.getCell("bid");
                bidCell.Text      = "-";
                bidCell.Alignment = 'C';
                NineCell trickCell = row.getCell("tricks");
                trickCell.Text      = "0";
                trickCell.Alignment = 'C';
            }
            scoreboard.blink(new Vector2(scoreboard.Position.X, 0f));
            scoreTab.blink(new Vector2(scoreTab.Position.X, scoreboard.Height));
            stowPosition    = Arranger.staticPoint(0f, 0f);
            stowPosition.Y -= scoreboard.Height;
            patchPos        = scoreboard.Position.ToPoint();
            patchSize       = new Point(69 * ScaleManager.InterfaceScale, scoreboard.Height);
            patchPos.X      = (int)((scoreTab.Position.X - (32.5f * ScaleManager.InterfaceScale)) + 0.5f);
        }
Ejemplo n.º 2
0
        public void setUp(int players, int currentPlayerID)
        {
            this.players         = players;
            this.currentPlayerID = currentPlayerID;
            clear();
            gameClient = GameClient.Instance;

            List <Card> tempList = new List <Card>();

            for (int i = 0; i < players; i++)
            {
                tempList.Add(null);
            }
            snap.arrange(tempList, 1);

            if (MainGame.Instance.HostOnly || SettingsHelper.Instance.ShowNameplates)
            {
                for (int i = 0; i < players; i++)
                {
                    Player currPlayer = ClientDataStore.Instance.Players[i];
                    int    index      = (players + (currPlayer.ID - currentPlayerID)) % players;
                    namePlates.Add(new NamePlate(
                                       snap.Nodes[index],
                                       snap.Rotations[index],
                                       22f * ScaleManager.CardScaleSmall,
                                       ScaleManager.CardScaleSmall,
                                       64f * ScaleManager.CardScaleSmall,
                                       currPlayer.Name,
                                       ColourHelper.getPlayerColour(currPlayer.ID, players),
                                       currPlayer.ID
                                       ));
                }
            }
        }
Ejemplo n.º 3
0
 public void playCard(Card card)
 {
     if (card != null)
     {
         card.GlowColour = ColourHelper.getPlayerColour(card.Raw.Player, players);
         card.Glow       = true;
     }
     if (playedCards.Contains(card))
     {
         return;
     }
     playedCards[playedCards.FindIndex(x => x == null)] = card;
 }
Ejemplo n.º 4
0
        public void addPlayer(Player player)
        {
            NineGridRow newPlayerRow = joinedGrid.getRow(player.ID.ToString());
            string      nameText     = player.Name;

            if (nameText.Length > 13)
            {
                nameText = nameText.Substring(0, 11) + "...";
            }
            newPlayerRow.getCell("player").Text = nameText;
            for (int i = 1; i <= player.ID; i++)
            {
                NineGridRow row = joinedGrid.getRow(i.ToString());
                row.getCell("player").Colour = ColourHelper.getPlayerColour(i, player.ID);
                row.getCell("player").Value  = player.ID;
            }
        }
Ejemplo n.º 5
0
        public void importCards(List <Card> imports)
        {
            if (!MainGame.Instance.HostOnly)
            {
                setTrump(imports[0]);
                imports.RemoveAt(0);

                foreach (Card card in imports)
                {
                    playCard(card);
                    if (card != null)
                    {
                        Console.Write("[importCards] card.Raw.Player=" + card.Raw.Player + ", ");
                        int playerID = Array.FindIndex(ClientDataStore.Instance.TrickCards, x => x == card.Raw) + 1;
                        Console.WriteLine("playerID=" + playerID);
                        card.GlowColour = ColourHelper.getPlayerColour(playerID, players);
                        card.Glow       = true;
                    }
                }
            }
        }
Ejemplo n.º 6
0
        public void populate()
        {
            List <Player> playerList = new List <Player>(ClientDataStore.Instance.Players);

            playerList.Sort((x, y) => x.Score.CompareTo(y.Score));
            for (int i = 0; i < playerList.Count; i++)
            {
                Player      player     = playerList[i];
                NineGridRow row        = scoreboard.getRow(i.ToString());
                NineCell    playerCell = row.getCell("player");
                string      nameText   = player.Name;
                if (nameText.Length > 15)
                {
                    nameText = nameText.Substring(0, 13) + "...";
                }
                playerCell.Text      = nameText;
                playerCell.Alignment = 'C';
                playerCell.Colour    = ColourHelper.getPlayerColour(player.ID, playerList.Count);
                NineCell scoreCell = row.getCell("score");
                scoreCell.Text      = player.Score.ToString();
                scoreCell.Alignment = 'C';
            }
        }
Ejemplo n.º 7
0
 public void setTrump(Card card)
 {
     cards[0]        = card;
     card.GlowColour = ColourHelper.getSuitColour(card.Suit);
     card.Glow       = true;
 }
Ejemplo n.º 8
0
 public void setTrump(Card trump)
 {
     this.trump       = trump;
     trump.GlowColour = ColourHelper.getSuitColour(trump.Suit);
     trump.Glow       = false;
 }