Exemplo n.º 1
0
    public void remove(Equip equip)
    {
        //Aquí se pone el equipo actual en el inventario.
        //Y le quito los buffs del objeto.
        inventoryManager.nounsInInventory.Add(equip);
        removeBuffs(equip);
        inventoryManager.DisplayInventory();

        if (equip.GetType() == typeof(Tool))
        {
            tool = null;
        }

        if (equip.GetType() == typeof(Outfit))
        {
            outfit = null;
        }

        if (equip.GetType() == typeof(Bag))
        {
            bag = null;
        }

        if (equip.GetType() == typeof(Accesory))
        {
            accesory = null;
        }
    }
Exemplo n.º 2
0
    public void put(Equip equip)
    {
        if (equip.GetType() == typeof(Tool))
        {
            if (tool != null)
            {
                remove(tool);
            }
            tool = equip as Tool;
            applyBuffs(tool);
        }

        if (equip.GetType() == typeof(Outfit))
        {
            if (outfit != null)
            {
                remove(outfit);
            }
            outfit = equip as Outfit;
            applyBuffs(outfit);
        }

        if (equip.GetType() == typeof(Bag))
        {
            if (bag != null)
            {
                remove(bag);
            }
            bag = equip as Bag;
            applyBuffs(bag);
        }

        if (equip.GetType() == typeof(Accesory))
        {
            if (accesory != null)
            {
                remove(accesory);
            }
            accesory = equip as Accesory;
            applyBuffs(accesory);
        }
        //Le doy los buffs del objeto.
        inventoryManager.DisplayInventory();
        updateText();
    }