示例#1
0
		public void ClearCardEntry()
        {
			name = "";
			editionID = 0;
			rarity = ERarity.Common;

			if (types == null) types = new List<ComplexTypeStruct>();
			types.Clear();

			if (colourSet == null) colourSet = new List<EColour>();
			colourSet.Clear();

			manaCost = uint.MaxValue;

			if (variation == null) variation = new List<EVariation>();
			variation.Clear();

			numberOfCards = 0;
			language = ELanguage.Unknown;
			value = 0;
			reservedLocationID = 0;
			if (currentLocationIDs == null) currentLocationIDs = new List<uint>();
			currentLocationIDs.Clear();

			if (standardEffectsID == null) standardEffectsID = new List<uint>();
			standardEffectsID.Clear();
		}
示例#2
0
        //------------------------------------------------------------------------------------------------------------------------
        //                                                  Item()
        //------------------------------------------------------------------------------------------------------------------------

        public Item(string name, string iconName, int amount, ERarity pRarity = ERarity.Common)
        {
            this.name     = name;
            this.iconName = iconName;
            this.Amount   = amount;
            rarity        = pRarity;
        }
示例#3
0
 public Item(string name, string iconName, int amount, List <Component> pComponents, ERarity pRarity = ERarity.Common)
 {
     this.name     = name;
     this.iconName = iconName;
     this.Amount   = amount;
     _components   = pComponents;
     rarity        = pRarity;
 }
示例#4
0
		public static string printERarity(ERarity rarity)
		{
			return Enum.GetName(typeof(ERarity), rarity);
		}
示例#5
0
    public void SingleGameSingleTypeNeutralWithOverpayingAccept()
    {
        HashSet <Asset> inventory = new() {
            CreateItem(1, 2),
            CreateItem(2, 2)
        };

        HashSet <Asset> itemsToGive = new() { CreateItem(2) };

        HashSet <Asset> itemsToReceive = new() {
            CreateItem(1),
            CreateItem(3)
        };

        Assert.IsTrue(IsFairExchange(itemsToGive, itemsToReceive));
        Assert.IsTrue(IsTradeNeutralOrBetter(inventory, itemsToGive, itemsToReceive));
    }

    private static Asset CreateItem(ulong classID, uint amount = 1, uint realAppID = Asset.SteamAppID, Asset.EType type = Asset.EType.TradingCard, Asset.ERarity rarity = Asset.ERarity.Common) => new(Asset.SteamAppID, Asset.SteamCommunityContextID, classID, amount, realAppID : realAppID, type : type, rarity : rarity);
}
示例#6
0
 public Meal(string name, int price, int satiety, ERarity rarity) : base(name, price, rarity)
 {
     Satiety = satiety;
 }
示例#7
0
 public Jacket(string name, int price, ERarity rarity) : base(name, price, rarity)
 {
 }
示例#8
0
 public Boots(string name, int price, ERarity rarity) : base(name, price, rarity)
 {
 }
示例#9
0
        public string RarityName()
        {
            ERarity enumRarity = (ERarity)Name;

            return(enumRarity.ToString());
        }
示例#10
0
        public static IDictionary <Guid, Info> ParseJson(string aJson)
        {
            var theList = new Dictionary <Guid, Info>();

            try
            {
                var theJson = JArray.Parse(aJson);

                foreach (var theItem in theJson)
                {
                    string theName = ( string )theItem["name"];
                    if (String.IsNullOrWhiteSpace(theName))
                    {
                        continue;
                    }

                    Guid theGuid;
                    if (!Guid.TryParse(( string )theItem["uuid"], out theGuid))
                    {
                        continue;
                    }

                    EItemType theType  = EItemType.Unknown;
                    var       theTypes = ( JArray )theItem["type"];
                    if (theTypes != null && theTypes.Count != 0)
                    {
                        var theFirstType = ( string )theTypes[0];
                        switch (theFirstType)
                        {
                        case "Basic Action":
                        case "Troop":
                        case "Artifact":
                        case "Constant":
                        case "Quick Action":
                        case "Quick":
                        case "Resource":
                            theType = EItemType.Card;
                            break;

                        case "Champion":
                            theType = EItemType.Champion;
                            break;

                        case "Equipment":
                            theType = EItemType.Equipment;
                            break;

                        case "Gem":
                            theType = EItemType.Gem;
                            break;

                        case "Pack":
                            theType = EItemType.Pack;
                            break;

                        case "Mod":
                            theType = EItemType.Mod;
                            break;

                        case "Bane":
                            theType = EItemType.Bane;
                            break;

                        default:
                            break;
                        }
                    }

                    ERarity theRarity       = ERarity.Unknown;
                    string  theRarityString = ( string )theItem["rarity"];
                    switch (theRarityString)
                    {
                    case "Promo":
                        theRarity = ERarity.Promo;
                        break;

                    case "Non-Collectible":
                        theRarity = ERarity.NonCollectible;
                        break;

                    case "Common":
                        theRarity = ERarity.Common;
                        break;

                    case "Uncommon":
                        theRarity = ERarity.Uncommon;
                        break;

                    case "Rare":
                        theRarity = ERarity.Rare;
                        break;

                    case "Legendary":
                        theRarity = ERarity.Legendary;
                        break;

                    case "Epic":
                        theRarity = ERarity.Epic;
                        break;

                    default:
                        theRarity = ERarity.Unknown;
                        break;
                    }

                    theList.Add(theGuid, new Info()
                    {
                        Name   = theName,
                        Type   = theType,
                        Rarity = theRarity
                    });
                }
            }
            catch {}

            return(theList);
        }
示例#11
0
 public Item(string name, int price, ERarity rarity = ERarity.Common)
 {
     this.Name   = name;
     this.Price  = price;
     this.Rarity = rarity;
 }