Beispiel #1
0
        public PokerInfo Clone()
        {
            PokerInfo info = new PokerInfo();

            info.id    = id;
            info.value = value;
            info.spr   = spr;
            info.type  = type;
            return(info);
        }
Beispiel #2
0
        /// <summary>
        /// 加载所有卡牌信息
        /// </summary>
        public static void LoadPoker()
        {
            XmlDocument doc = new XmlDocument();

            doc.LoadXml((ResourcesManage.dictionary["Data"] as TextAsset).text);
            XmlNodeList list = doc.SelectSingleNode("root/poker").ChildNodes;

            foreach (XmlElement item in list)
            {
                PokerInfo poker = new PokerInfo();
                poker.id    = int.Parse(item.GetAttribute("id"));
                poker.value = int.Parse(item.GetAttribute("value"));
                poker.spr   = ResourcesManage.CreateSprite(item.GetAttribute("id"));
                poker.type  = (PokerType)int.Parse(item.GetAttribute("se"));
                listAll.Add(poker);
            }
        }