Exemplo n.º 1
0
    public Item SetPart(Item item, string partName)
    {
        Item tmpItem = null;

        switch (partName)
        {
        case "LeftArm": tmpItem = armLeft; armLeft = item; break;

        case "RightArm": tmpItem = armRight; armRight = item; break;

        case "Eyes": tmpItem = eyes; eyes = item; break;

        case "Body": tmpItem = body; body = item; break;

        case "RightLeg": tmpItem = legRight; legRight = item; break;

        case "LeftLeg": tmpItem = legLeft; legLeft = item; break;

        case "Heart": tmpItem = heart; heart = item; break;

        case "Lungs": tmpItem = lungs; lungs = item; break;

        case "Stomach": tmpItem = stomach; stomach = item; break;
        }

        OnItemListChanged?.Invoke(this, EventArgs.Empty);
        OnPartUpdated?.Invoke(this, EventArgs.Empty);
        return(tmpItem);
    }
Exemplo n.º 2
0
    public void RemovePart(string partName)
    {
        switch (partName)
        {
        case "LeftArm": armLeft = null; break;

        case "RightArm": armRight = null; break;

        case "Eyes": eyes = null; break;

        case "Body": body = null; break;

        case "RightLeg": legRight = null; break;

        case "LeftLeg": legLeft = null; break;

        case "Heart": heart = null; break;

        case "Lungs": lungs = null; break;

        case "Stomach": stomach = null; break;
        }
        OnItemListChanged?.Invoke(this, EventArgs.Empty);
        OnPartUpdated?.Invoke(this, EventArgs.Empty);
    }