Ejemplo n.º 1
0
    public void ChangeSlot(int i)
    {
        PlayerSlot previousSlot = null;
        PlayerSlot targetSlot   = null;

        foreach (PlayerSlot slot in slots)
        {
            if (slot.nr == i)
            {
                targetSlot = slot;
            }
            else if (slot.nr == playerTeam.nr)
            {
                previousSlot = slot;
            }
        }

        targetSlot.Occupy(playerTeam, previousSlot);
    }