commit
d406f0f9c6
@ -29,6 +29,7 @@ package com.iluwatar.decorator;
|
|||||||
*/
|
*/
|
||||||
public class Troll implements Hostile {
|
public class Troll implements Hostile {
|
||||||
|
|
||||||
|
@Override
|
||||||
public void attack() {
|
public void attack() {
|
||||||
System.out.println("The troll swings at you with a club!");
|
System.out.println("The troll swings at you with a club!");
|
||||||
}
|
}
|
||||||
@ -38,6 +39,7 @@ public class Troll implements Hostile {
|
|||||||
return 10;
|
return 10;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void fleeBattle() {
|
public void fleeBattle() {
|
||||||
System.out.println("The troll shrieks in horror and runs away!");
|
System.out.println("The troll shrieks in horror and runs away!");
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user