| 
									
										
										
										
											2016-08-30 13:29:12 +02:00
										 |  |  | @startuml | 
					
						
							|  |  |  | package com.iluwatar.decorator { | 
					
						
							| 
									
										
										
										
											2016-09-18 17:51:09 +03:00
										 |  |  |   interface Hostile { | 
					
						
							|  |  |  |     + attack() {abstract} | 
					
						
							|  |  |  |     + fleeBattle() {abstract} | 
					
						
							|  |  |  |     + getAttackPower() : int {abstract} | 
					
						
							|  |  |  |   } | 
					
						
							| 
									
										
										
										
											2016-08-30 13:29:12 +02:00
										 |  |  |   class App { | 
					
						
							|  |  |  |     + App() | 
					
						
							|  |  |  |     + main(args : String[]) {static} | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  |   class Troll { | 
					
						
							|  |  |  |     + Troll() | 
					
						
							|  |  |  |     + attack() | 
					
						
							|  |  |  |     + fleeBattle() | 
					
						
							|  |  |  |     + getAttackPower() : int | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  |   class SmartHostile { | 
					
						
							|  |  |  |     - decorated : Hostile | 
					
						
							|  |  |  |     + SmartHostile(decorated : Hostile) | 
					
						
							|  |  |  |     + attack() | 
					
						
							|  |  |  |     + fleeBattle() | 
					
						
							|  |  |  |     + getAttackPower() : int | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | SmartHostile -->  "-decorated" Hostile | 
					
						
							|  |  |  | Troll ..|> Hostile  | 
					
						
							|  |  |  | SmartHostile ..|> Hostile  | 
					
						
							|  |  |  | @enduml |