Advertisement
Guest User

Untitled

a guest
Jan 16th, 2019
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.30 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace Moj_Program
  8. {
  9. abstract class Stworzenie
  10. {
  11.  
  12. public string nazwa { get; set; }
  13. public int punktyHP;
  14. public int silaAtaku;
  15. public int poziom;
  16. public int monety;
  17. public int ekwipunek;
  18.  
  19. virtual public void Wyswietl()
  20. {
  21. Console.WriteLine(nazwa);
  22. }
  23. }
  24.  
  25. class Zwierze : Stworzenie
  26. {
  27. public Zwierze(string nazwa, int punktyHP, int silaAtaku)
  28. {
  29. this.nazwa = nazwa;
  30. this.punktyHP = punktyHP;
  31. this.silaAtaku = silaAtaku;
  32. }
  33. override public void Wyswietl()
  34. {
  35. Console.WriteLine(nazwa + " " + punktyHP + " " + silaAtaku);
  36. }
  37. }
  38. class Czlowiek : Stworzenie
  39. {
  40. public Czlowiek(string nazwa,int punktyHP, int silaAtaku, int monety)
  41. {
  42. this.nazwa = nazwa;
  43. this.punktyHP = punktyHP;
  44. this.silaAtaku = silaAtaku;
  45. this.monety = monety;
  46.  
  47. }
  48. override public void Wyswietl()
  49. {
  50. Console.WriteLine(nazwa + " " + punktyHP + " " + silaAtaku + " " + monety);
  51. }
  52. }
  53. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement