void generateFootballerField(FootballerData data)
    {
        PackedScene             scene = (PackedScene)ResourceLoader.Load("Scenes/AdvancedComponents/FootballerFullInfoField.tscn");
        FootballerFullInfoField field = (FootballerFullInfoField)scene.Instance();

        field.Initialize(data);

        footballersList.AddChild(field);
    }
Пример #2
0
    public void Initialize(string userAlias, int footballerDBId)
    {
        data = DBReader.GetFootballerData(footballerDBId);

        setAlias(userAlias);
        setName(data.Name);
        setSurname(data.Surname);
        setCountry(data.Country);
        setPositionIcon(data.NativePosition);
    }
Пример #3
0
    public void Initialize(FootballerData footballerData)
    {
        loadComponents();
        initialized = true;

        this.footballerData = footballerData;
        initializeEnduranceBar();

        setCountry();
        setSurname();
    }
    void generateFootballerField(FootballerData data)
    {
        PackedScene scene = (PackedScene)ResourceLoader.Load("Scenes/AdvancedComponents/FootballerShortInfoField.tscn");
        FootballerShortInfoField field = (FootballerShortInfoField)scene.Instance();

        string name    = data.Name;
        string surname = data.Surname;
        int    age     = GameData.CURRENT_YEAR - data.BirthYear;
        int    avg     = data.Average;
        string country = ValidCountries.CountryToString(data.Country);

        field.Initialize(name, surname, age, avg, country);

        footballersList.AddChild(field);
    }
    void buildFootballersInfo()
    {
        string tablesRequested = $"{Footballers.ID}";
        string conditions      = $"{Footballers.TEAM_ID} = {GameData.CurrentTeam.TeamData.Id}";
        string command         = $"SELECT {tablesRequested} WHERE {conditions};";

        List <Row> rows = CommandParser.ParseCommand(command, $"{GameData.DB_PATH}/{Footballers.TABLE_PATH}");

        foreach (Row row in rows)
        {
            int            id   = int.Parse(row.Values[0]);
            FootballerData data = DBReader.GetFootballerData(id);
            generateFootballerField(data);
        }
    }
    public void Initialize(FootballerData footballerData)
    {
        loadComponents();
        FootballerData = footballerData;

        acceleration.Text  = footballerData.Acceleration.ToString();
        age.Text           = (GameData.CURRENT_YEAR - footballerData.BirthYear).ToString();
        average.Text       = footballerData.Average.ToString();
        decceleration.Text = footballerData.Decceleration.ToString();
        endurance.Text     = footballerData.Endurance.ToString();
        force.Text         = footballerData.Force.ToString();
        name.Text          = footballerData.Name;
        power.Text         = footballerData.Power.ToString();
        size.Text          = footballerData.Size.ToString();
        speed.Text         = footballerData.Speed.ToString();
        surname.Text       = footballerData.Surname;
        setCountry(footballerData.Country);
    }
    public void UpdateTeam()
    {
        clearFootballersList();
        clearTeamDataPanel();

        string columnsRequested = $"{Footballers.ID}";
        string conditions       = $"{Footballers.TEAM_ID} = {GameData.CurrentTeamDBId}";
        string command          = $"SELECT {columnsRequested} WHERE {conditions};";

        List <Row>            rows            = CommandParser.ParseCommand(command, $"{GameData.DB_PATH}/{Footballers.TABLE_PATH}");
        List <FootballerData> footballersData = new List <FootballerData>();

        foreach (Row row in rows)
        {
            int            id   = int.Parse(row.Values[0]);
            FootballerData data = DBReader.GetFootballerData(id);
            footballersData.Add(data);
            generateFootballerField(data);
        }

        updateTeamData(footballersData);
    }