summaryrefslogtreecommitdiff
path: root/engine
diff options
context:
space:
mode:
authorSho Sakuma <me@m1sk9.dev>2026-08-02 19:24:41 +0900
committerSho Sakuma <me@m1sk9.dev>2026-08-02 19:24:41 +0900
commit232ce55f187d7ec0cea2037d8d285d60465e51ff (patch)
tree23792eb011e4780a6ea6155342cecf6f580f7f90 /engine
parentb04e76be78398b5739e27cc0cc606a6c1ac8c232 (diff)
downloadLunaticChat-232ce55f187d7ec0cea2037d8d285d60465e51ff.tar.gz
LunaticChat-232ce55f187d7ec0cea2037d8d285d60465e51ff.tar.bz2
LunaticChat-232ce55f187d7ec0cea2037d8d285d60465e51ff.zip
refactor: describe a setting once, on its SettingKey
The three setting handlers were the same 53-line class three times over, differing in one copy() field, one read, and two message keys. Adding persistence, auditing or a permission check to settings meant writing it three times, and a fourth setting meant a fourth copy. A setting is its key, the messages that report it, and how it is read from and written to PlayerChatSettings - so SettingKey now carries all of that, and SettingHandler is the single mechanism that applies it. The registry keeps its role as the seam where features decide which settings exist, which is why registration is still conditional in LunaticChat. SettingHandlerTest now asserts over every SettingKey rather than repeating five near-identical tests per handler, so a new setting is covered the moment it is declared. It also pins down the property that made the old duplication dangerous: writing one setting must not disturb the others. Co-Authored-By: Claude <noreply@anthropic.com>
Diffstat (limited to 'engine')
0 files changed, 0 insertions, 0 deletions