mirror of
https://github.com/tiennm99/java-design-patterns.git
synced 2026-10-03 15:11:56 +00:00
commit
d406f0f9c6
1 file changed
+2
@@ -29,6 +29,7 @@ package com.iluwatar.decorator;
|
||||
*/
|
||||
public class Troll implements Hostile {
|
||||
|
||||
@Override
|
||||
public void attack() {
|
||||
System.out.println("The troll swings at you with a club!");
|
||||
}
|
||||
@@ -38,6 +39,7 @@ public class Troll implements Hostile {
|
||||
return 10;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fleeBattle() {
|
||||
System.out.println("The troll shrieks in horror and runs away!");
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user