Make Card.storage expect the manager's uuid first #404

Closed
opened 2025-10-31 08:59:23 +00:00 by LunarTides · 1 comment
LunarTides commented 2025-10-31 08:59:23 +00:00 (Migrated from github.com)

Since the stuff in Card.storage (the host's storage) should only really be messed with by the card that put the stuff there (the manager), we can do: host.storage[manager.uuid].someProperty = 3. This is better than host.storage.someProperty[manager.uuid] = 3, especially since we don't need to check if someProperty exists in former case.

If a card needs to change another card's managed storage, the interloper must do the bare minimum due dilligence of finding the manager's uuid.

  • Change the type of Card.storage to expect a uuid first. This is breaking, of course.
Since the stuff in `Card.storage` (the **host**'s storage) should only *really* be messed with by the card that put the stuff there (the **manager**), we can do: `host.storage[manager.uuid].someProperty = 3`. This is better than `host.storage.someProperty[manager.uuid] = 3`, especially since we don't need to check if `someProperty` exists in former case. If a card needs to change another card's managed storage, *the interloper must do the bare minimum due dilligence* of finding the manager's uuid. - [x] Change the type of `Card.storage` to expect a uuid first. This is breaking, of course.
LunarTides commented 2025-11-07 16:17:23 +00:00 (Migrated from github.com)

Closed by 4d5a628

Closed by 4d5a628
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#404
No description provided.