Advertisement
Guest User

Untitled

a guest
Oct 21st, 2019
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.32 KB | None | 0 0
  1. public class Held {
  2.  
  3. // Anfang Attribute
  4. protected String name;
  5. protected int staerke;
  6. protected int angriffswert;
  7. protected int lebenspunkte; //
  8. protected Waffe meineWaffe;
  9. // Ende Attribute
  10.  
  11. public Held(String pNa, int pSt, int pLp, Waffe pWa) {
  12. this.name = pNa;
  13. this.staerke = pSt;
  14. this.lebenspunkte = pLp;
  15. this.meineWaffe = pWa;
  16. angriffswertBerechnen();
  17. }
  18.  
  19. // Anfang Methoden
  20.  
  21. public void kaempfen(){
  22. }
  23.  
  24. public void angriffswertBerechnen() {
  25. angriffswert = staerke + meineWaffe.getBonus();
  26. }
  27.  
  28. public String getName() {
  29. return name;
  30. }
  31.  
  32. public void setName(String pNa) {
  33. this.name = pNa;
  34. }
  35.  
  36. public int getStaerke() {
  37. return staerke;
  38. }
  39.  
  40. public void setStaerke(int pSt) {
  41. this.staerke = pSt;
  42. }
  43.  
  44. public int getAngriffswert() {
  45. return angriffswert;
  46. }
  47.  
  48. public void setAngriffswert(int pAw) {
  49. this.angriffswert = pAw;
  50. }
  51.  
  52. public int getLebenspunkte() {
  53. return lebenspunkte;
  54. }
  55.  
  56. public void setLebenspunkte(int pLp) {
  57. this.lebenspunkte = pLp;
  58. }
  59.  
  60. public Waffe getWaffe() {
  61. return meineWaffe;
  62. }
  63.  
  64. public void setWaffe(Waffe meineWaffe) {
  65. this.meineWaffe = meineWaffe;
  66. }
  67.  
  68. // Ende Methoden
  69.  
  70. } // end of Held
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement