generated from FabricMC/fabric-example-mod
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathenvironment-controller.puml
57 lines (44 loc) · 1.75 KB
/
environment-controller.puml
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
@startuml
hide empty member
skinparam backgroundColor #dddddd
class EnvironmentManager <<singleton>> {
-controller: EnvironmentController
+addController(constructor: Function<EnvironmentController, EnvironmentController>)
}
note left of EnvironmentManager::addController
The param would usually be something
like MyDecorator::new
end note
interface EnvironmentController {
+{abstract} getLocalTemperatureChange(world: World, pos: BlockPos): int
+{abstract} getOnFireWarmthRate(entity: LivingEntity): int
+{abstract} getHotFloorWarmth(state: BlockState): int
+{abstract} getPowderSnowFreezeRate(entity: LivingEntity): int
+{abstract} getSoakChange(entity: LivingEntity): int
+{abstract} getHeatAtLocation(world: World, pos: BlockPos): int
+{abstract} getHeatFromBlockState(state: BlockState): int
+{abstract} isHeatSource(state: BlockState): int
+{abstract} isAreaHeated(world: World, pos: BlockPos): int
}
class EmptyEnvironmentController {
}
note right of EmptyEnvironmentController
All methods are implemented with a 0, false, or null return value,
depending on the type.
end note
abstract class EnvironmentControllerDecorator {
#controller: EnvironmentController
#EnvironmentControllerDecorator(controller: EnvironmentController)
}
note left of EnvironmentControllerDecorator
All EnvironmentController methods are implemented here by just
calling the same method on its controller field
end note
note bottom of EnvironmentControllerDecorator
Extend this class to add your functionality
end note
EnvironmentManager *--right-- EnvironmentController
EnvironmentController <|.. EmptyEnvironmentController
EnvironmentController <|... EnvironmentControllerDecorator
EnvironmentController ---* EnvironmentControllerDecorator
@enduml