All pastes #770623 Raw Edit

Player

public java v1 · immutable
·published 2007-11-12 13:28 UTC
rendered paste body
public class Player {	int power;	int attackment;	String playerName;	boolean isDead = true;		public Player(String playerName, int power, int attackment) {		this.playerName = playerName;		this.attackment = attackment;	}		public Player(String playerName) {		this.playerName = playerName;		this.attackment = 20;		this.power = 100;	}		public void power(int power) {		this.power = power;	}		public int getpower() {		return power;	}		public String getplayerName() {		return playerName;	}		public void attack(Player person) {		System.out.println(getplayerName() + "attack" + person.getplayerName());	}		public boolean isDead() {		return (power <= 0);	}		public void makeAttack(Player attacker,Player target) {		target.power -= attacker.attackment;		attacker.power += attacker.attackment/2;	}}