29 lines
		
	
	
		
			580 B
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			29 lines
		
	
	
		
			580 B
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
| @startuml
 | |
| package com.iluwatar.decorator {
 | |
|   interface Hostile {
 | |
|     + attack() {abstract}
 | |
|     + fleeBattle() {abstract}
 | |
|     + getAttackPower() : int {abstract}
 | |
|   }
 | |
|   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 |