 
 import UIKit
 
-class Person {
+protocol Person {
+    func show()
+}
+
+struct Boy: Person {
     var name = ""
-    
+
     init() {}
-    
     init(_ name: String) {
         self.name = name
     }

    }
}

var p = Person("Kingcos")
let tShirtA = TShirt()
let chineseTunicSuitA = ChineseTunicSuit()

// 按顺序装饰
tShirtA.decorate(p)
chineseTunicSuitA.decorate(tShirtA)

chineseTunicSuitA.show()

let tShirtB = TShirt()
let chineseTunicSuitB = ChineseTunicSuit()

chineseTunicSuitB.decorate(p)
tShirtB.decorate(chineseTunicSuitB)

tShirtB.show()


// 饰物
class Finery: Person {
    var component: Person
    
    init(_ component: Person) {
        self.component = component
    }
    
    func show() {
        component.show()
    }
}
