Exemplo n.º 1
0
 public MTGCard(int id, string name, bool isBlack, bool isBlue, bool isGreen, bool isRed, bool isWhite,
                bool isColorless, string manaCost, string cmc, TypeRarity rarity, string mainType, string secondaryType,
                string cardSubtype, string keywords, string activateAbility, string triggerAbility, string staticAbility,
                int power, int toughness, int collectionNumber, MTGSet mTGSet)
 {
     Id               = id;
     Name             = name;
     IsBlack          = isBlack;
     IsBlue           = isBlue;
     IsGreen          = isGreen;
     IsRed            = isRed;
     IsWhite          = isWhite;
     IsColorless      = isColorless;
     ManaCost         = manaCost;
     Cmc              = cmc;
     Rarity           = rarity;
     MainType         = mainType;
     SecondaryType    = secondaryType;
     CardSubtype      = cardSubtype;
     Keywords         = keywords;
     ActivateAbility  = activateAbility;
     TriggerAbility   = triggerAbility;
     StaticAbility    = staticAbility;
     Power            = power;
     Toughness        = toughness;
     CollectionNumber = collectionNumber;
     MTGSet           = mTGSet;
 }
Exemplo n.º 2
0
    /// <summary>
    /// 判断是否开启红点
    /// </summary>
    /// <returns></returns>
    public static bool IsOpenDot()
    {
        List <GoodsData> goods = new List <GoodsData>();

        for (int i = 0; i < StaticData.playerInfoData.userInfo.WareHoseInfo.Count; i++)
        {
            CSWareHouseStruct cSData = StaticData.playerInfoData.userInfo.WareHoseInfo[i];
            if (cSData.GoodNum > 0 && IsBePutInStorage(cSData.GoodId))
            {
                GoodsData goodsData = new GoodsData();
                goodsData.Initial(cSData);
                goods.Add(goodsData);
            }
        }
        for (int i = 0; i < goods.Count; i++)
        {
            if (goods[i]._data.ItemType != TypeGameItem.TreasureChest && IsNewGoods(goods[i]))
            {
                return(true);
            }
        }
        List <GoodsData>      treasureChaests      = GetTreasureChests(goods);
        Dictionary <int, int> treasureChaestsIndex = new Dictionary <int, int>();

        for (int i = 0; i < treasureChaests.Count; i++)
        {
            GoodsData  treasureChaestsData = treasureChaests[i];
            TypeRarity key       = treasureChaestsData._data.Rarity;
            int        keyNumber = (int)key;
            if (treasureChaestsIndex.ContainsKey(keyNumber))
            {
                int index = treasureChaestsIndex[keyNumber];
                treasureChaestsIndex[keyNumber] = index + 1;
            }
            else
            {
                treasureChaestsIndex.Add(keyNumber, 1);
            }
        }
        foreach (var item in treasureChaestsIndex)
        {
            int index = GetTreasureChaestsValue(item.Key);
            if (index < item.Value)
            {
                return(true);
            }
        }
        //for (int i = 0; i < treasureChaests.Count; i++)
        //{
        //    if (IsThereAnUnlock(treasureChaests[i]._id))
        //    {
        //        return true;
        //    }
        //}
        return(false);
    }