public class App5 {
public static void main(String[] args) {
AirAttacker atk = new AirAttacker();
atk.attack("Player");
atk.fly(10, 5, 6);
}
}
interface Flyable{
void fly(int x, int y, int z);
}
interface Moveable{
void move(int x, int y);
}
interface Attackable{
void attack(String target);
}
abstract class Unit{
int hp;
int mp;
int exp;
Unit(int hp, int mp, int exp){
this.hp = hp;
this.mp = mp;
this.exp = exp;
}
abstract void attacked(int damage);
abstract void defeated();
}
interface FlyAttacker extends Flyable, Attackable{
abstract void airToground();
}
class AirAttacker implements Flyable, Attackable{
@Override
public void attack(String target) {
System.out.println("Attack on : " + target);
}
@Override
public void fly(int x, int y, int z) {
System.out.println("Move to : " + x + y + z);
}
}
class Dragon extends Unit implements FlyAttacker{
Dragon(int hp, int mp, int exp) {
super(hp, mp, exp);
//TODO Auto-generated constructor stub
}
@Override
public void attack(String target) {
// TODO Auto-generated method stub
}
@Override
public void fly(int x, int y, int z) {
// TODO Auto-generated method stub
}
@Override
void attacked(int damage) {
// TODO Auto-generated method stub
}
@Override
void defeated() {
// TODO Auto-generated method stub
}
@Override
public void airToground() {
// TODO Auto-generated method stub
}
}