/// <summary> /// Funkcja ulepsza budynek tartak albo wyswietla informacje o zbyt malej ilosci zasobow /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void buttonUpgradeWoodshet_Click(object sender, EventArgs e) { // wywolanie funkcji sprawdzajacej czy ilosc zasobow jest wystarczajaca if (IfEnoughtResources(labelWoodshetCostWood, labelWoodshetCostStone, labelWoodshetCostIron, labelWoodshetCostCrystals) == true) { // zwiekszenie poziomu budynku ElvishBuildings.LevelOfWoodshet += 1; // pobranie ceny rozbudowy budynku z klasy Buildings cost = ElvishBuildings.WoodshetCost(); // wywolanie funkcji, ktora wyswietli koszty rozbudowy na kolejny poziom budynku ConstructionCostLabels(cost, labelWoodshetCostWood, labelWoodshetCostStone, labelWoodshetCostIron, labelWoodshetCostCrystals); } else { // wyswietlenie wiadomosci MessageBox.Show("Niewystarczająca ilość zasobów!"); } }
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); }