-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplayer.command.plantuml
More file actions
54 lines (44 loc) · 985 Bytes
/
player.command.plantuml
File metadata and controls
54 lines (44 loc) · 985 Bytes
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
@startuml
interface Command {
+ execute()
}
class AttackCommand implements Command {
- character: ICharacter
- params: Params
+ AttackCommand(params Params)
+ execute()
}
class MoveCommand implements Command {
- character: ICharacter
- param: Param
+ MoveCommand(params Params)
+ execute()
}
class UseItemCommand implements Command {
- character: ICharacter
- param: Param
+ UseItemCommand(params Params)
+ execute()
}
class Invoker {
- command: Command
+ setCommand(command: Command)
+ executeCommand()
}
class CommandHistory {
- history: Command[]
+ push(c: Command)
+ pop(c: Command)
}
Invoker o-- Command
Invoker --> CommandHistory
CommandHistory *--> Command
AttackCommand o--> ICharacter
MoveCommand o--> ICharacter
UseItemCommand o--> ICharacter
interface ICharacter {
+ attack(damage: int, target: IEnemy)
+ move(speed: int, direction: Direction)
+ useItem(item: Item)
}
@enduml