Exemple #1
0
        //todo fix for show face down cards lol typevalue
        private CardDrawing findCard(CardGameTableSpace wantedSpace, CardGameCard card)
        {
            string id = "dv_card_" + card.Type + "_" + card.Value;
            var space = findSpace(wantedSpace);

            CardDrawing doc;
            if (cards[id] != null) {
                var m = Document.GetElementById(id);
                if (m.ParentNode != ( space.OuterElement )) {
                    m.ParentNode.RemoveChild(m);
                    space.OuterElement.AppendChild(m);
                }

                doc = cards[id];
            } else {
                var sp = Document.CreateElement("div");
                sp.ID = id;
                jQuery.FromElement(space.OuterElement).Append(sp);

                var cardImage = cloneImage(cardImages[drawCard(card)]);
                sp.AppendChild(cardImage);
                sp.Style.Position = "absolute";

                doc = cards[id] = new CardDrawing(sp);
            }

            return doc;
        }
Exemple #2
0
 public string drawCard(CardGameCard card)
 {
     var src = "";
     var domain = BuildSite.TopLevelURL + "assets";
     src = domain + "/cards/" + ( 100 + ( card.Value + 1 ) + ( card.Type ) * 13 );
     return src + ".gif";
 }