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 Moj_Program
- {
- abstract class Stworzenie
- {
- public string nazwa { get; set; }
- public int punktyHP;
- public int silaAtaku;
- public int poziom;
- public int monety;
- public int ekwipunek;
- virtual public void Wyswietl()
- {
- Console.WriteLine(nazwa);
- }
- }
- class Zwierze : Stworzenie
- {
- public Zwierze(string nazwa, int punktyHP, int silaAtaku)
- {
- this.nazwa = nazwa;
- this.punktyHP = punktyHP;
- this.silaAtaku = silaAtaku;
- }
- override public void Wyswietl()
- {
- Console.WriteLine(nazwa + " " + punktyHP + " " + silaAtaku);
- }
- }
- class Czlowiek : Stworzenie
- {
- public Czlowiek(string nazwa,int punktyHP, int silaAtaku, int monety)
- {
- this.nazwa = nazwa;
- this.punktyHP = punktyHP;
- this.silaAtaku = silaAtaku;
- this.monety = monety;
- }
- override public void Wyswietl()
- {
- Console.WriteLine(nazwa + " " + punktyHP + " " + silaAtaku + " " + monety);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement