示例#1
0
    public bool RemoveLoot(AbsLoot loot)
    {
        Type type = loot.GetType();

        if (dictionary.ContainsKey(type))
        {
            dictionary [type] = dictionary [type] - 1;
            --totalCount;
            return(true);
        }
        return(false);
    }
示例#2
0
    public void PutLoot(AbsLoot loot)
    {
        Type type = loot.GetType();

        if (dictionary.ContainsKey(type))
        {
            dictionary [type] = dictionary [type] + 1;
        }
        else
        {
            dictionary.Add(type, 1);
        }
        ++totalCount;
        Debug.Log(totalCount + " loots");
        Debug.Log(dictionary);
    }
示例#3
0
    public int GetLootCount(AbsLoot loot)
    {
        Type type = loot.GetType();

        return(dictionary.ContainsKey(type) ? dictionary [type] : 0);
    }