Advertisement
Guest User

Untitled

a guest
Nov 20th, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. package de.paycash.api;
  2.  
  3. public class Fighter extends Thread {
  4.  
  5.  
  6. private int hp;
  7. private String name;
  8.  
  9. public Fighter(String name, int hp) {
  10. this.name = name;
  11. this.hp = hp;
  12. }
  13.  
  14. @Override
  15. public void run() {
  16. while (true) {
  17. /**
  18. * your fight goes here
  19. */
  20.  
  21. if (hp <= 0) {
  22. this.interrupt();
  23. }
  24.  
  25. }
  26.  
  27.  
  28. }
  29.  
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement