Пример #1
0
    public int AddPlayer(FantasyPlayer player)
    {
        int slotIndex = -1;

        if (SlotPlayer1.Name == EMPTY)
        {
            SlotPlayer1.Configure(player);
            slotIndex = 0;
        }
        else if (SlotPlayer2.Name == EMPTY)
        {
            SlotPlayer2.Configure(player);
            slotIndex = 1;
        }
        else if (SlotPlayer3.Name == EMPTY)
        {
            SlotPlayer3.Configure(player);
            slotIndex = 2;
        }
        else if (SlotPlayer4.Name == EMPTY)
        {
            SlotPlayer4.Configure(player);
            slotIndex = 3;
        }
        else
        {
            Logging.LogError("Unable to add player to slot");
        }

        return(slotIndex);
    }