-
Notifications
You must be signed in to change notification settings - Fork 0
/
weapon.strategy.plantuml
63 lines (52 loc) · 1.15 KB
/
weapon.strategy.plantuml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
@startuml
hide footbox
interface IWeapon {
+ attack1()
+ attack2()
}
class Sword implements IWeapon {
+ physicalDamage : int
+ magicalDamage : int
+ criticalRate : int
+ attackSpeed : int
-strategy: ShootingStrategy
+ attack1()
+ attack2()
+setStrategy(strategy: ShootingStrategy): void
+shoot(): void
}
class Bow implements IWeapon {
+ physicalDamage : int
+ magicalDamage : int
+ criticalRate : int
+ attackSpeed : int
-strategy: ShootingStrategy
+ attack1()
+ attack2()
+setStrategy(strategy: ShootingStrategy): void
+shoot(): void
}
class Wand implements IWeapon {
+ physicalDamage : int
+ magicalDamage : int
+ criticalRate : int
+ attackSpeed : int
-strategy: ShootingStrategy
+ attack1()
+ attack2()
+setStrategy(strategy: ShootingStrategy): void
+shoot(): void
}
interface ShootingStrategy {
+shoot(): void
}
class StraightShooting implements ShootingStrategy {
+shoot(): void
}
class FanShooting implements ShootingStrategy {
+shoot(): void
}
Bow o--> ShootingStrategy
Sword o--> ShootingStrategy
Wand o--> ShootingStrategy
@enduml