Beispiel #1
0
    public override bool UseItem(Item otherItem)
    {
        if (otherItem is Key)
        {
            locked = !locked;
        }
        else if (otherItem is Oven)
        {
            Oven oven = otherItem as Oven;

            Item itemRemoved = oven.RemoveItem(this);

            if (itemRemoved != null)
            {
                for (int j = 0, length = itemsInside.Length; j < length; j++)
                {
                    Item item = itemsInside[j];

                    if (item != null && item is Key)
                    {
                        oven.AddItem(item);
                    }
                }
            }
        }

        return(true);
    }
Beispiel #2
0
    public override bool UseItem(Item otherItem)
    {
        if (otherItem is Oven)
        {
            Oven oven = otherItem as Oven;
            oven.RemoveItem(this);
        }

        return(true);
    }