Esempio n. 1
0
    public async void Load_data()//ladowanie nazw firm
    {
        List <Data_player_building> C_data = await SQL_Manager.Select <Data_player_building>("Player_building");

        List <Data_building> B_data = await SQL_Manager.Select <Data_building>("Building");

        D_Company_A.ClearOptions();
        D_Company_B.ClearOptions();
        List <TMP_Dropdown.OptionData> companys = new List <TMP_Dropdown.OptionData>();



        foreach (var p in C_data)
        {
            foreach (var b in B_data)
            {
                if (p.Id_building == b.Id)
                {
                    companys.Add(new TMP_Dropdown.OptionData(p.Id.ToString() + "# " + b.Name));
                }
            }
        }
        D_Company_A.AddOptions(companys);
        D_Company_B.AddOptions(companys);
    }
Esempio n. 2
0
    public async void Refresh(int itemId) //wczytuje item z podanego id
    {
        data_item = await SQL_Manager.Select <Data_item>("Item", itemId);

        Name.text   = data_item.Name;
        Price.text  = data_item.Cost.ToString() + "$";
        amount.text = data_item_stack.Amount.ToString();
    }
Esempio n. 3
0
    public async void Load(GameObject parent)
    {
        List <Data_player_building> buildings = await SQL_Manager.Select <Data_player_building>("Player_building");

        foreach (var data_a in buildings)
        {
            Data_building data_b = await SQL_Manager.Select <Data_building>("Building", data_a.Id_building);

            GameObject temp = Load_object_Sql(data_a, data_b);
            temp.transform.parent = parent.transform;
        }
    }
Esempio n. 4
0
    async Task Load_List(E_Build_type type)
    {
        List <Data_building> temp = await SQL_Manager.Select <Data_building>("Building");

        foreach (var d in temp)
        {
            if (d.Id_type == (int)type)
            {
                Data.Add(d);
            }
        }
    }
Esempio n. 5
0
    public async void Load_new_data(Building building)
    {
        gameObject.SetActive(true);

        this.building = building;
        Data_player_building data_player_building = building.B_data_player_building;
        Data_building        data_building        = await SQL_Manager.Select <Data_building>("Building", data_player_building.Id_building);

        G_Name.text = data_building.Name;
        G_time.text = "Time: " + building.time.ToString() + " Sec";
        G_item1.Refresh(building.Id_i1);
    }
    public async void Load_Company_products(int List_Id)//pobiera produkty z magazynu i wyswietla je
    {
        gameObject.SetActive(true);
        Clear_Items();
        List <Data_item_stack> products = await SQL_Manager.Select <Data_item_stack>("Item_list", List_Id, true);

        foreach (var p in products)
        {
            GameObject item = new Gui_item().Get_new_objectSQL(p, null);
            item.transform.parent = Content.transform;
        }
    }
Esempio n. 7
0
    async Task Refresh_Company_data()
    {
        //wczytywanie zawartosci wybranego budynku
        string p1 = D_Company_A.options[D_Company_A.value].text;
        string p2 = D_Company_B.options[D_Company_B.value].text;


        p1 = p1.Substring(0, p1.LastIndexOf("#"));
        p2 = p2.Substring(0, p2.LastIndexOf("#"));

        building1 = await SQL_Manager.Select <Data_player_building>("Player_building", int.Parse(p1));

        building2 = await SQL_Manager.Select <Data_player_building>("Player_building", int.Parse(p2));
    }
    public async void New_Select(Data_player_building d1, List <Data_item_stack> output)
    {
        Refresh_Lists();
        this.Output = output;
        List <Data_item_stack> Data = await SQL_Manager.Select <Data_item_stack>("Item_list", d1.Id_list, true);

        foreach (var d in Data)
        {
            GameObject item = new Gui_item().Get_new_objectSQL(d, null);
            item.transform.parent = content_A.transform;
            item.GetComponent <Gui_item>().Button.onClick.AddListener(() => Select_Company(item));
            List_from.Add(item);
        }
    }