예제 #1
0
        private void updateHands()
        {
            lock (hand)
            {
                for (int j = 0; j < MAXHANDSIZE; j++)
                {
                    if (hand.ContainsKey("hand" + j)) hand.Remove("hand" + j);
                    if (hand.ContainsKey("glow" + j)) hand.Remove("glow" + j);
                }

                int k = 0;
                foreach (string c in player.getHand())
                {
                    Game1.cards[c].setPosition(new Vector2(MARGIN + 40 + (CARDWIDTH + MARGIN * 2) * k + (CARDWIDTH / 2 + MARGIN) * (7 - player.getHand().Count), 205)).setWidth(CARDWIDTH).setHeight(CARDHEIGHT);
                    Game1.cards[c].z = 2;
                    hand.Add("hand" + k, Game1.cards[c]);
                    Visual v = new Visual(Game1.cards[c]).setRelativePosition(new Vector2(-1, -1)).setRelativeHeight(2).setRelativeWidth(2);
                    v.z = 3;
                    if (Game1.client.constructCost(c) == 0) v.setTexture("greenglow");
                    else if (Game1.client.constructCost(c) > 0) v.setTexture("goldglow");
                    else v.setTexture("redglow");
                    hand.Add("glow" + k, v);
                    k++;
                }
                hand["papermiddle"].setPosition(new Vector2(MARGIN + 30 + (CARDWIDTH / 2 + MARGIN) * (7 - player.getHand().Count) + 1, 190)).setWidth(Game1.WIDTH - (MARGIN + 30 + (CARDWIDTH / 2 + MARGIN) * (7 - player.getHand().Count) + 1));
            }
        }