Draft
Conversation
Add isInstant()/isSorcery() to CardStateView, isSpell()/isTrigger()/ getActivatingPlayer() tracked properties to SpellAbilityView, toString() override to GameEntityView, and Serializable to GameEvent. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Change canonical fields from Card/Player to CardView/PlayerView with convenience constructors for backward compatibility. Fix cascading compilation in GameLogFormatter, FControlGameEventHandler, FControlGamePlayback, QuestController, CMatchUI, IGuiGame, and AbstractGuiGame. Change handleLandPlayed to accept CardView. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Convert remaining complex events to use view types (CardView, PlayerView, SpellAbilityView, StackItemView, GameEntityView) instead of engine types. Includes convenience constructors for backward compatibility at call sites. Complex conversions include: - Collection/map events (CardStatsChanged, CardRegenerated, CombatEnded, CombatUpdate, AttackersDeclared, BlockersDeclared, AnteCardsSelected, PlayerStatsChanged) - SpellAbility events (SpellAbilityCast, SpellResolved, SpellRemovedFromStack) with pre-computed fields - Zone events (CardChangeZone, Zone, ManaPool, CardAttachment) - Game lifecycle events (GameStarted, GameOutcome, PlayerControl) Update all visitors (GameLogFormatter, FControlGameEventHandler, FControlGamePlayback, EventVisualizer, CMatchUI) to work with view types returned by event accessors. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add handleGameEvent protocol method to forward all GameEvents from server to client. Events are now serializable (view-based fields) and can be sent directly through the existing Netty pipeline. Changes: - ProtocolMethod: add handleGameEvent(GameEvent) entry - IGuiGame: add handleGameEvent(GameEvent) interface method - AbstractGuiGame: default no-op implementation - NetGuiGame: override to updateGameView() then send event to client - HostedMatch: forward all events to GUI instances after visiting Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Remove 5 ProtocolMethod entries now replaced by GameEvent forwarding: - updatePlayerControl, updateZones, updateCards, updateManaPool, updateLives Remove corresponding NetGuiGame overrides that sent these as separate protocol messages. Add no-op defaults in AbstractGuiGame for the interface methods (still called locally by event visitors). IGuiGame signatures are kept — only the network-specific forwarding is removed. Event forwarding via handleGameEvent now carries the equivalent data to clients. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Fix SpellAbilityView NPE: defer isSpell/isTrigger/activatingPlayer updates from constructor to lazy getView(), preventing NPE when WrappedAbility.sa is null during super() construction - Fix GameEventManaPool NPE: guard null mana in convenience constructor (ManaPool.clearPool fires with null mana on Cleared events) - Add GameEventSerializationTest: 9 tests validating ObjectOutputStream round-trips for view-typed event records (simple, collection, null safety, pre-computed fields, no-field events) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
SoundSystem received GameEvents via direct event bus subscription, which only exists on the host. Move sound triggering to AbstractGuiGame.handleGameEvent() so the client plays sounds when events arrive over the network protocol. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
@tool4ever here is the GameEvent refactor.
This has been done based on the refactor plan which has been updated to reflect implementation. See implementation notes section for deviations from original plan.
I have not had a chance to test in depth yet - but unit test is succesful and local network testing indicates client is at least playing sounds now.
In relation to subgame events Claude ran into an issue, summarised below: