Files
Antone Barbaud b02e532563 docs: organize diagrams to mirror code layout (util/ + features/)
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>
2026-06-10 13:58:48 +02:00

111 lines
2.8 KiB
Plaintext

@startuml player-class-diagram
title CR-Core — Player domain (class diagram)
skinparam classAttributeIconSize 0
hide empty members
' === Common abstractions ===
package "fr.luc.crcore.util.common" {
interface Identifiable {
+ getId(): UUID
}
interface ScoreHolder {
+ getScore(name): int
+ hasScore(name): boolean
+ getScores(): Map<String, Integer>
+ getTotalScore(): int
+ addScore(name, delta): int
+ setScore(name, value): int
+ resetScore(name): boolean
+ resetAllScores(): void
}
abstract class AbstractEntity {
- id: UUID
+ getId(): UUID
}
interface "Repository<T extends Identifiable>" as Repository {
+ save(entity: T): T
+ findById(id): Optional<T>
+ findAll(): Collection<T>
+ delete(id): boolean
}
AbstractEntity ..|> Identifiable
}
' === Player domain ===
package "fr.luc.crcore.features.player" {
class PlayerProfile {
- scores: Map<String, Integer>
+ PlayerProfile(playerId: UUID)
+ getPlayerId(): UUID
}
class PlayerRanking <<record>> {
+ rank: int
+ profile: PlayerProfile
+ score: int
}
interface PlayerProfileRepository
class InMemoryPlayerProfileRepository {
- profiles: Map<UUID, PlayerProfile>
}
interface PlayerProfileService {
+ getOrCreateProfile(playerId): PlayerProfile
+ getProfile(playerId): Optional<PlayerProfile>
+ deleteProfile(playerId): boolean
+ getAllProfiles(): Collection<PlayerProfile>
--
+ addScore(playerId, name, delta): int
+ setScore(playerId, name, value): int
+ getScore(playerId, name): int
+ resetScore(playerId, name): boolean
+ resetAllScores(playerId): void
--
+ getRankingByScore(name): List<PlayerRanking>
+ getGlobalRanking(): List<PlayerRanking>
+ getTopRankingByScore(name, limit): List<PlayerRanking>
+ getTopGlobalRanking(limit): List<PlayerRanking>
}
class PlayerProfileServiceImpl {
- repository: PlayerProfileRepository
--
# newProfile(playerId): PlayerProfile
# newRanking(rank, profile, score): PlayerRanking
# rank(scoreFn): List<PlayerRanking>
--
# onProfileCreated(profile): void
# onProfileDeleted(profile): void
# onScoreChanged(profile, name, oldV, newV): void
}
class PlayerException
class PlayerProfileNotFoundException
PlayerProfile --|> AbstractEntity
PlayerProfile ..|> ScoreHolder
PlayerProfileRepository --|> Repository
InMemoryPlayerProfileRepository ..|> PlayerProfileRepository
PlayerProfileServiceImpl ..|> PlayerProfileService
PlayerRanking --> PlayerProfile
PlayerProfileServiceImpl o--> PlayerProfileRepository
PlayerProfileService ..> PlayerRanking : produces
PlayerException --|> RuntimeException
PlayerProfileNotFoundException --|> PlayerException
}
@enduml