System.Collections.Generic.IDictionary.ContainsKey(ItemCraft)

Here are the examples of the csharp api System.Collections.Generic.IDictionary.ContainsKey(ItemCraft) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

1 Examples 7

19 Source : ItemParser.cs
with MIT License
from Sectoidfodder

public int Compare(ItemCraft x, ItemCraft y)
        {
            ItemProperties props;
            IDictionary<string, double> stats;
            if (Cache.ContainsKey(x))
            {
                props = Cache[x].Properties;
                stats = Cache[x].Stats;
            }
            else
            {
                props = ItemParser.ParseProperties(x);
                stats = ItemParser.ParseItem(x);
                Cache.Add(x, new ItemParams() { Properties = props, Stats = stats });
            }
            double? vx = ItemParser.GetValueByName(Key, x, props, stats);
            if (Cache.ContainsKey(y))
            {
                props = Cache[y].Properties;
                stats = Cache[y].Stats;
            }
            else
            {
                props = ItemParser.ParseProperties(y);
                stats = ItemParser.ParseItem(y);
                Cache.Add(y, new ItemParams() { Properties = props, Stats = stats });
            }
            double? vy = ItemParser.GetValueByName(Key, y, props, stats);
            if (vx != null)
            {
                if (vy != null)
                    return vx.Value.CompareTo(vy.Value);
                else
                    return 1;
            }
            else
            {
                if (vy != null)
                    return -1;
                else
                    return 0;
            }
        }