ModernUO/Projects/UOContent/Engines/ConPVP
Kamron Batman 70a69d3efe
perf: Migrate ConPVP game board gumps to DynamicGump (#2419)
## Summary

Migrates the four ConPVP game board (scoreboard) gumps from legacy `Gump` to `DynamicGump`:

- **`BRBoardGump`** (Bombing Run) — variable layout: row-per-team based on `Participants.Count`. Migrated to `DynamicGump`, `Singleton`, private constructor + `DisplayTo`, `SetNoClose()`.
- **`CTFBoardGump`** (Capture the Flag) — variable layout: row-per-team filtered to only teams with a flag. Same migration shape.
- **`DDBoardGump`** (Double Domination) — variable layout: row-per-team. Same migration shape.
- **`KHBoardGump`** (King of the Hill) — variable layout: row-per-team. `sealed`. Same migration shape.

### Refresh-via-this decision

For all four boards, **score data lives on the `*Game` / `*TeamInfo` objects, not the gump**. The gump just renders a snapshot of those values at the moment it is sent. The three call sites per board are:

1. `OnDoubleClick` on the in-world scoreboard item — one-shot manual open.
2. After death/kill score events (in `OnDeath`) — game logic pushes a fresh board to the dying player so they see updated scores.
3. End-of-game broadcast loop — sends final results to every participant.

None of these are button-driven refreshes from inside the gump, and the gump owns no mutable state. Therefore each event allocates a fresh gump (now via `DisplayTo(...)`) rather than calling `SendGump(this)` on a long-lived instance — that pattern doesn't fit when the data source is external. The win comes from `DynamicGump`'s ref-struct builder writing directly to buffers, eliminating the legacy `GumpEntry` list allocations on every send.

### Mechanics

- `: Gump` → `: DynamicGump`; layout moved from constructor to `BuildLayout(ref DynamicGumpBuilder)`.
- `Closable = false` → `builder.SetNoClose()`.
- Constructors are `private`; static `DisplayTo(Mobile, *Game, ...)` validates `mob?.NetState != null && game != null` before constructing.
- Team-section-mode parameter (`section`) preserved on BR / CTF / DD as an optional `DisplayTo` param even though no current caller uses it.
- The four `m_Game` / similar fields are renamed to `_game`; new fields use `_camelCase` per CLAUDE.md §12.
- `AddBorderedText` / `AddColoredText` helpers became `static` and take `ref DynamicGumpBuilder`.
- Updated all 12 internal call sites (3 per file) to go through `DisplayTo`. No external callers.
- No `OnResponse` was defined on any of these gumps (the only button is a close button), so no `RelayInfo` signature changes were needed.

Touches 4 game files, but only the gump classes — game logic (BR death/scoring, CTF flag handling, DD domination, KH king timer) is untouched.
2026-04-26 09:55:46 -07:00
..
Games perf: Migrate ConPVP game board gumps to DynamicGump (#2419) 2026-04-26 09:55:46 -07:00
Gumps feat: Add zero-alloc interpolation handler to ValueStringBuilder, replace all StringBuilder usage (#2387) 2026-03-22 14:23:44 -07:00
AcceptDuelGump.cs fix: Fix NetStateGumps and other Gumps cleanup (#1919) 2024-08-10 09:57:28 -07:00
Arena.cs fix: Fixes region priority and resolution. (#1254) 2022-11-21 10:38:20 -08:00
DuelContext.cs feat: T2A defensive spells (#2378) 2026-03-22 11:18:34 -07:00
DuelTeleporterAddon.cs fix: Converts ConPVP to serialization generator (#2338) 2026-02-14 14:50:10 -08:00
Ladder.cs chore: Cleans up pattern checks. (#892) 2021-12-24 15:53:59 -08:00
Participant.cs feat: Add zero-alloc interpolation handler to ValueStringBuilder, replace all StringBuilder usage (#2387) 2026-03-22 14:23:44 -07:00
Preferences.cs feat: Moves gumps out of the core (#1916) 2024-08-09 19:07:32 -07:00
Ruleset.cs C# 9 Cleanup (#325) 2020-11-27 00:29:21 -08:00
RulesetLayout.cs C# 9 Cleanup (#325) 2020-11-27 00:29:21 -08:00
SafeZone.cs fix: Fixes region priority and resolution. (#1254) 2022-11-21 10:38:20 -08:00
Tournament.cs feat: Add zero-alloc interpolation handler to ValueStringBuilder, replace all StringBuilder usage (#2387) 2026-03-22 14:23:44 -07:00
TournamentBracketItem.cs fix: Converts ConPVP to serialization generator (#2338) 2026-02-14 14:50:10 -08:00
TournamentController.cs feat: Moves gumps out of the core (#1916) 2024-08-09 19:07:32 -07:00
TournamentPyramid.cs feat: Adds Mobile.Murderer virtual property, consolidates kill-threshold checks (#2355) 2026-03-06 08:36:41 -08:00
TournamentRegistrar.cs fix: Converts ConPVP to serialization generator (#2338) 2026-02-14 14:50:10 -08:00
TournamentSignupItem.cs fix: Converts ConPVP to serialization generator (#2338) 2026-02-14 14:50:10 -08:00
TourneyParticipant.cs feat: Add zero-alloc interpolation handler to ValueStringBuilder, replace all StringBuilder usage (#2387) 2026-03-22 14:23:44 -07:00
Trophy.cs fix: Codegens faction items and questers (#1764) 2024-05-08 17:16:36 -07:00