Esempio n. 1
0
 /// <summary>
 /// Funckja ulepsza budynek infrastruktura lub wyswietla informacje o niewystarczajacych ilosciach zasobow
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void buttonUpgradeInfrastructure_Click(object sender, EventArgs e)
 {
     if (IfEnoughtResources(labelInfrastructureCostWood, labelInfrastructureCostStone, labelInfrastructureCostIron, labelInfrastructureCostCrystals) == true)
     {
         // Zwiekszenie poziomu budynku
         ElvishBuildings.LevelOfInfrastructure += 1;
         // pobranie nowej ceny rozbudowy budynku z klasy Buildings
         cost = ElvishBuildings.InfrastructureCost();
         // wywolanie funkcji, ktora wyswietli koszty rozbudowy na kolejny poziom budynku
         ConstructionCostLabels(cost, labelInfrastructureCostWood, labelInfrastructureCostStone, labelInfrastructureCostIron, labelInfrastructureCostCrystals);
     }
     else
     {
         MessageBox.Show("Niewystarczająca ilość zasobów!");
     }
 }
Esempio n. 2
0
 /// <summary>
 /// Funkcja ulepsza budynek chata mysliwska albo wyswietla informacje o zbyt malej ilosci zasobow
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void buttonUgradeHuntingBuild_Click(object sender, EventArgs e)
 {
     // wywolanie funkcji sprawdzajacej czy ilosc zasobow jest wystarczajaca
     if (IfEnoughtResources(labelHuntingBuildingCostWood, labelHuntingBuildingCostStone, labelHuntingBuildingCostIron, labelHuntingBuildingCostCrystals) == true)
     {
         // zwiekszenie poziomu budynku
         ElvishBuildings.LevelOfHuntingBuilding += 1;
         //HountingBuildingConstructionCost();
         cost = ElvishBuildings.HuntingBuildingCost();
         // wywolanie funkcji, ktora wyswietli koszty rozbudowy na kolejny poziom budynku
         ConstructionCostLabels(cost, labelHuntingBuildingCostWood, labelHuntingBuildingCostStone, labelHuntingBuildingCostIron, labelHuntingBuildingCostCrystals);
     }
     else
     {
         // wyswietlenie wiadomosci
         MessageBox.Show("Niewystarczająca ilość zasobów!");
     }
 }
Esempio n. 3
0
        /// <summary>
        /// Funckja ulepsza budynek szkola sztuki walki lub wyswietla informacje o niewystarczajacych ilosciach zasobow
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>

        private void buttonUpgradeMartialArtsSchool_Click(object sender, EventArgs e)
        {
            if (IfEnoughtResources(labelMartialArtsSchoolCostWood, labelMartialArtsSchoolCostStone, labelMartialArtsSchoolCostIron, labelMartialArtsSchoolCostCrystals) == true)
            {
                // Zwiekszenie poziomu budynku
                ElvishBuildings.LevelOfMartialArtsSchool += 1;
                // pobranie nowej ceny rozbudowy budynku z klasy Buildings
                cost = ElvishBuildings.MartialArtsSchoolCost();
                // wywolanie funkcji, ktora wyswietli koszty rozbudowy na kolejny poziom budynku
                ConstructionCostLabels(cost, labelMartialArtsSchoolCostWood, labelMartialArtsSchoolCostStone, labelMartialArtsSchoolCostIron, labelMartialArtsSchoolCostCrystals);
            }
            else
            {
                MessageBox.Show("Niewystarczająca ilość zasobów!");
            }

            // maksymalny poziom budynku,  na 20lv szkolenie jednostek trwa 0sec
            if (ElvishBuildings.LevelOfMartialArtsSchool == 20)
            {
                buttonUpgradeMartialArtsSchool.Enabled = false;
            }
        }
Esempio n. 4
0
        private void timerUpdaterLvlOfBuildingsAndCostOfConstruct_Tick(object sender, EventArgs e)
        {
            // wyswietlenie aktualnego pozimu budynku chata mysliwska
            labelLevelOfHuntingBuilding.Text = ElvishBuildings.LevelOfHuntingBuilding.ToString();
            // wyswietlenie aktualnego pozimu budynku tartak
            labelLevelOfWoodshet.Text = ElvishBuildings.LevelOfWoodshet.ToString();
            // wyswietlenie aktualnego pozimu budynku kamieniolom
            labelLevelOfQuarry.Text = ElvishBuildings.LevelOfQuarry.ToString();
            // wyswietlenie aktualnego pozimu budynku huta
            labelLevelOfIronWorks.Text = ElvishBuildings.LevelOfIronWorks.ToString();
            // wyswietlenie aktualnego pozimu budynku kopalnia krysztalow
            labelLevelOfCrystalsMine.Text = ElvishBuildings.LevelOfCrystalMine.ToString();
            // wyswietlenie aktualnego pozimu budynku domy
            labelLevelOfHouses.Text = ElvishBuildings.LevelOfHouses.ToString();
            // wyswietlenie aktualnego pozimu budynku swiatynia
            labelLevelOfTemple.Text = ElvishBuildings.LevelOfTemple.ToString();
            // wyswietlenie aktualnego pozimu budynku fikusne elfickie budynki
            labelLevelOfElvishBuilding.Text = ElvishBuildings.LevelOfElvishBuilding.ToString();
            // wyswietlenie aktualnego pozimu budynku szkola sztuk walki
            labelLevelOfMartialArtsSchool.Text = ElvishBuildings.LevelOfMartialArtsSchool.ToString();
            // wyswietlenie aktualnego pozimu budynku infrastruktura
            labelLevelOfInfrastructure.Text = ElvishBuildings.LevelOfInfrastructure.ToString();

            // pobranie aktualnej ceny z klasy Buildings
            cost = ElvishBuildings.HuntingBuildingCost();
            // wyswietlenie aktualnej ceny w labelach, ktore sa argumentami wywolywanej funkcji
            ConstructionCostLabels(cost, labelHuntingBuildingCostWood, labelHuntingBuildingCostStone, labelHuntingBuildingCostIron, labelHuntingBuildingCostCrystals);
            // pobranie aktualnej ceny z klasy Buildings
            cost = ElvishBuildings.WoodshetCost();
            // wyswietlenie aktualnej ceny w labelach, ktore sa argumentami wywolywanej funkcji
            ConstructionCostLabels(cost, labelWoodshetCostWood, labelWoodshetCostStone, labelWoodshetCostIron, labelWoodshetCostCrystals);
            // pobranie aktualnej ceny z klasy Buildings
            cost = ElvishBuildings.QuarryCost();
            // wyswietlenie aktualnej ceny w labelach, ktore sa argumentami wywolywanej funkcji
            ConstructionCostLabels(cost, labelQuarryCostWood, labelQuarryCostStone, labelQuarryCostIron, labelQuarryCostCrystals);
            // pobranie aktualnej ceny z klasy Buildings
            cost = ElvishBuildings.IronWorksCost();
            // wyswietlenie aktualnej ceny w labelach, ktore sa argumentami wywolywanej funkcji
            ConstructionCostLabels(cost, labelIronWorksCostWood, labelIronWorksCostStone, labelIronWorksCostIron, labelIronWorksCostCrystals);
            // pobranie aktualnej ceny z klasy Buildings
            cost = ElvishBuildings.CrystalMineCost();
            // wyswietlenie aktualnej ceny w labelach, ktore sa argumentami wywolywanej funkcji
            ConstructionCostLabels(cost, labelCrystalMineCostWood, labelCrystalMineCostStone, labelCrystalMineCostIron, labelCrystalMineCostCrystals);
            // pobranie aktualnej ceny z klasy Buildings
            cost = ElvishBuildings.HousesCost();
            // wyswietlenie aktualnej ceny w labelach, ktore sa argumentami wywolywanej funkcji
            ConstructionCostLabels(cost, labelHousesCostWood, labelHousesCostStone, labelHousesCostIron, labelHousesCostCrystals);
            // pobranie aktualnej ceny z klasy Buildings
            cost = ElvishBuildings.TempleCost();
            // wyswietlenie aktualnej ceny w labelach, ktore sa argumentami wywolywanej funkcji
            ConstructionCostLabels(cost, labelTempleCostWood, labelTempleCostStone, labelTempleCostIron, labelTempleCostCrystals);
            // pobranie aktualnej ceny z klasy Buildings
            cost = ElvishBuildings.ElvishBuildingCost();
            // wyswietlenie aktualnej ceny w labelach, ktore sa argumentami wywolywanej funkcji
            ConstructionCostLabels(cost, labelElvishBuildingCostWood, labelElvishBuildingCostStone, labelElvishBuildingCostIron, labelElvishBuildingCostCrystals);
            // pobranie aktualnej ceny z klasy Buildings
            cost = ElvishBuildings.MartialArtsSchoolCost();
            // wyswietlenie aktualnej ceny w labelach, ktore sa argumentami wywolywanej funkcji
            ConstructionCostLabels(cost, labelMartialArtsSchoolCostWood, labelMartialArtsSchoolCostStone, labelMartialArtsSchoolCostIron, labelMartialArtsSchoolCostCrystals);
            // pobranie aktualnej ceny z klasy Buildings
            cost = ElvishBuildings.InfrastructureCost();
            // wyswietlenie aktualnej ceny w labelach, ktore sa argumentami wywolywanej funkcji
            ConstructionCostLabels(cost, labelInfrastructureCostWood, labelInfrastructureCostStone, labelInfrastructureCostIron, labelInfrastructureCostCrystals);
        }