Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace ConsoleApp17
- {
- class Program
- {
- static void Main(string[] args)
- {
- Profesja kupiec = new Profesja("Kupiec", 0, -10);
- Profesja wojownik = new Profesja("Wojownik", 15, 10);
- Console.ReadKey();
- }
- }
- class Profesja
- {
- public Profesja(string nazwa, float atk, float obr)
- {
- Nazwa = nazwa;
- BonusDoAtaku = atk;
- BonusDoObrony = obr;
- }
- public string Nazwa;
- public float BonusDoAtaku;
- public float BonusDoObrony;
- }
- class Postac
- {
- public string Imie;
- public Profesja Profesja;
- public float PunktyZycia;
- public float PunktyAtaku;
- public float PunktyObrony;
- public Postac()
- {
- PunktyZycia = 100f;
- }
- public Postac(string imie, Profesja profesja, float atk, float obr)
- {
- PunktyZycia = 100f;
- Imie = imie;
- Profesja = profesja;
- PunktyAtaku = atk;
- PunktyObrony = obr;
- }
- public bool CzyZyje()
- {
- if(PunktyZycia > 0)
- {
- return true;
- }
- return false;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement