Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package de.paycash.api;
- public class Fighter extends Thread {
- private int hp;
- private String name;
- public Fighter(String name, int hp) {
- this.name = name;
- this.hp = hp;
- }
- @Override
- public void run() {
- while (true) {
- /**
- * your fight goes here
- */
- if (hp <= 0) {
- this.interrupt();
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement