Example #1
0
    public bool AddItem(Item itemToAdd)
    {
        switch (itemToAdd.itemType)
        {
        case Item.ItemType.COIN:
            if (itemToAdd.quantity > 99)
            {
                return(false);
            }
            return(AddCoinAmmo(itemToAdd));

        case Item.ItemType.MAP:
            return(AddMap(itemToAdd));

        case Item.ItemType.SLINGSHOT:
            playerAttack.AddWeapon(new SlingshotWeapon(playerAttack));
            return(AddWeapon(itemToAdd));

        case Item.ItemType.AXE:
            playerAttack.AddWeapon(new AxeWeapon(playerAttack));
            return(AddWeapon(itemToAdd));

        case Item.ItemType.AMMO:
            return(AddCoinAmmo(itemToAdd));

        default:
            break;
        }
        return(false);
    }