![]() |
Cockatrice 2026-03-05-Development-2.11.0-beta.54
A virtual tabletop for multiplayer card games
|
Utilities for Z-value validation and layer management. More...
Enumerations | |
| enum class | Layer { Zone , Card , Overlay } |
| Semantic layer identifiers for Z-value allocation. More... | |
Functions | |
| constexpr bool | isValidCardZValue (qreal zValue) |
| Validates that a Z-value is within the valid card range. | |
| constexpr bool | isOverlayZValue (qreal zValue) |
| Validates that a Z-value is in the overlay layer. | |
| constexpr qreal | overlayZValue (qreal offset) |
| Returns the Z-value for a specific overlay element. | |
Variables | |
| constexpr qreal | CARD_Z_VALUE_MAX = 40000000.0 |
| Maximum Z-value a card can have on the table zone. | |
| constexpr qreal | OVERLAY_BASE = 2000000000.0 |
| Base Z-value for overlay elements. | |
Utilities for Z-value validation and layer management.
|
strong |
Semantic layer identifiers for Z-value allocation.
These represent conceptual rendering layers, not actual Z-values. Use the corresponding ZValues constants for actual rendering.
| Enumerator | |
|---|---|
| Zone | Zone-level elements like backgrounds and containers. |
| Card | Cards rendered in zones (uses sequential Z-values) |
| Overlay | Temporary UI elements like hovered cards and drag items. |
|
nodiscardconstexpr |
Validates that a Z-value is in the overlay layer.
Overlay elements should have Z-values at or above OVERLAY_BASE.
| zValue | The Z-value to validate |
|
nodiscardconstexpr |
Validates that a Z-value is within the valid card range.
Cards should have Z-values between CARD_BASE (1.0) and CARD_Z_VALUE_MAX. Values outside this range may interfere with overlay rendering.
| zValue | The Z-value to validate |
|
nodiscardconstexpr |
Returns the Z-value for a specific overlay element.
| offset | Offset from OVERLAY_BASE (0-7 for current elements) |
|
constexpr |
Maximum Z-value a card can have on the table zone.
Based on table zone formula: (actualY + CARD_HEIGHT) * 100000 + (actualX + 1) * 100 With maximum 3 rows and CARD_HEIGHT ~96, actualY <= ~289. Maximum: (289 + 96) * 100000 + 100 * 100 = 38,510,000
We use 40,000,000 as a safe upper bound with margin.
|
constexpr |
Base Z-value for overlay elements.
Must exceed CARD_Z_VALUE_MAX to ensure overlays render above all cards. The 50x margin (2B vs 40M) provides safety for future expansion.