b02e532563
Move flat docs/diagrams/*.puml into a hierarchy matching the source
package structure:
docs/diagrams/
├── bootstrap-sequence.puml (cross-cutting)
├── events-diagram.puml (cross-feature)
├── util/
│ ├── command-class-diagram.puml
│ ├── database-diagram.puml
│ ├── messages-class-diagram.puml
│ ├── broadcasts-class-diagram.puml
│ └── gui-class-diagram.puml
└── features/
├── team/
│ ├── team-class-diagram.puml
│ ├── team-config-class-diagram.puml
│ ├── builtin-commands-diagram.puml
│ ├── team-create-sequence.puml
│ ├── team-create-activity.puml
│ └── team-join-sequence.puml
├── player/
│ └── player-class-diagram.puml
└── moderation/
└── moderation-class-diagram.puml
README.md diagram index split into 4 sections (overview, util,
features/team, features/player, features/moderation) for readability;
all links updated. features.md auto-updated by sed for the new paths.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
103 lines
3.0 KiB
Plaintext
103 lines
3.0 KiB
Plaintext
@startuml broadcasts-class-diagram
|
|
title CR-Core — Broadcast service (class diagram)
|
|
|
|
skinparam classAttributeIconSize 0
|
|
hide empty members
|
|
|
|
package "fr.luc.crcore.util.broadcast" {
|
|
|
|
enum BroadcastAudience {
|
|
NONE
|
|
LEADER
|
|
TEAM
|
|
ADMIN
|
|
ALL
|
|
}
|
|
|
|
class BroadcastContext {
|
|
- team: Team
|
|
- involvedPlayerId: UUID
|
|
- placeholders: Map<String, String>
|
|
--
|
|
+ {static} of(team): BroadcastContext
|
|
+ {static} empty(): BroadcastContext
|
|
+ involving(playerId): BroadcastContext
|
|
+ with(key, value): BroadcastContext
|
|
+ getTeam(): Optional<Team>
|
|
+ getInvolvedPlayerId(): Optional<UUID>
|
|
+ getPlaceholders(): Map<String, String>
|
|
+ toPlaceholderPairs(): Object[]
|
|
}
|
|
|
|
interface BroadcastService {
|
|
+ broadcast(eventKey, context): void
|
|
+ getAudiences(eventKey): List<BroadcastAudience>
|
|
+ reload(): void
|
|
}
|
|
|
|
class CRCoreBroadcastListener {
|
|
- broadcasts: BroadcastService
|
|
+ registerOn(plugin: JavaPlugin): void
|
|
--
|
|
@ onTeamCreate(TeamCreateEvent)
|
|
@ onTeamDissolve(TeamDissolveEvent)
|
|
@ onTeamMemberAdd(TeamMemberAddEvent)
|
|
@ onTeamMemberRemove(TeamMemberRemoveEvent)
|
|
@ onPlayerJoinTeam(PlayerJoinTeamEvent)
|
|
@ onLeadershipTransfer(TeamLeadershipTransferEvent)
|
|
@ onVisibilityChange(TeamVisibilityChangeEvent)
|
|
@ onTeamScoreChange(TeamScoreChangeEvent)
|
|
@ onTeamSpawnChange(TeamSpawnPointChangeEvent)
|
|
@ onProfileCreate(PlayerProfileCreateEvent)
|
|
@ onProfileDelete(PlayerProfileDeleteEvent)
|
|
@ onPlayerScoreChange(PlayerScoreChangeEvent)
|
|
}
|
|
CRCoreBroadcastListener ..|> "org.bukkit.event.Listener"
|
|
|
|
package "fr.luc.crcore.util.broadcast.impl" {
|
|
class YamlBroadcastService {
|
|
- plugin: JavaPlugin
|
|
- messages: MessagesService
|
|
- defaults: Map<String, List<BroadcastAudience>>
|
|
- audiences: Map<String, List<BroadcastAudience>>
|
|
- userFile: File
|
|
--
|
|
+ YamlBroadcastService(plugin, messages)
|
|
- loadDefaultsFromResource(): void
|
|
- ensureUserFile(): void
|
|
- rebuildEffectiveAudiences(): void
|
|
- resolveRecipients(list, ctx): Set<Player>
|
|
}
|
|
YamlBroadcastService ..|> BroadcastService
|
|
}
|
|
|
|
BroadcastService ..> BroadcastContext : consumes
|
|
BroadcastContext --> BroadcastAudience
|
|
YamlBroadcastService --> "fr.luc.crcore.util.message.MessagesService" : reads templates
|
|
CRCoreBroadcastListener --> BroadcastService : delegates
|
|
CRCoreBroadcastListener ..> BroadcastContext : builds
|
|
}
|
|
|
|
package "fr.luc.crcore" {
|
|
class CRCore {
|
|
+ broadcasts(): BroadcastService
|
|
# buildBroadcastService(messages): BroadcastService
|
|
}
|
|
CRCore "1" *-- "1" BroadcastService : owns
|
|
CRCore ..> CRCoreBroadcastListener : registers
|
|
}
|
|
|
|
note bottom of YamlBroadcastService
|
|
Modèle "un seul fichier par plugin" :
|
|
|
|
Sources en mémoire :
|
|
1. crcore-broadcasts.yml ← jar (fallback)
|
|
2. <plugin>-broadcasts.yml ← dataFolder (édité par l'admin)
|
|
|
|
Séparation routes / templates :
|
|
- Routes = ce fichier (qui reçoit quoi)
|
|
- Templates = MessagesService (clés <event>.broadcast)
|
|
end note
|
|
|
|
@enduml
|