Add history trees #477

Closed
opened 2026-02-24 15:00:05 +00:00 by LunarTides · 0 comments
LunarTides commented 2026-02-24 15:00:05 +00:00 (Migrated from github.com)

I'm thinking that events that happen due to other events should be treated as children of that event.

For example, when you play a minion, the following events get broadcast, in order:

ChangeLocation {card} None // The card is removed from the player's hand
PlayCardUnsafe {card} // The card might be played. It can still be cancelled after this event is broadcast.
// Other potential events due to battlecry...
ChangeLocation {card} Board // The card is added to the board
PlayCard {card} // The card is confirmed played.

Note: The history will claim that the PlayCardUnsafe event was broadcast after ChangeLocation Board. This is inaccurate. The PlayCardUnsafe event is added to the history after ChangeLocation Board.

Instead of this, the event could look something like this:

PlayCard {card}
|   - ChangeLocation {card} None
|   - PlayCardUnsafe {card}
|   - // ...
|   - ChangeLocation {card} Board
|   - PlayCard {card}

Events from the other player should also be under this event. This would make the history easier to read and understand, as you can see what lead up to the event triggering.

This should also support the parent event being the child of another event.

I'm thinking that events that happen due to other events should be treated as children of that event. For example, when you play a minion, the following events get broadcast, in order: ```ts ChangeLocation {card} None // The card is removed from the player's hand PlayCardUnsafe {card} // The card might be played. It can still be cancelled after this event is broadcast. // Other potential events due to battlecry... ChangeLocation {card} Board // The card is added to the board PlayCard {card} // The card is confirmed played. ``` > Note: The history will claim that the `PlayCardUnsafe` event was broadcast *after* `ChangeLocation Board`. This is inaccurate. The `PlayCardUnsafe` event is added to the *history* after `ChangeLocation Board`. Instead of this, the event could look something like this: ```ts PlayCard {card} | - ChangeLocation {card} None | - PlayCardUnsafe {card} | - // ... | - ChangeLocation {card} Board | - PlayCard {card} ``` Events from the other player should also be under this event. This would make the history easier to read and understand, as you can see what lead up to the event triggering. This should also support the parent event being the child of another event.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
LunarTides/Hearthstone.js#477
No description provided.