Cockatrice 2026-03-05-Development-2.11.0-beta.54
A virtual tabletop for multiplayer card games
Loading...
Searching...
No Matches
ZValueLayerManager Namespace Reference

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.

Detailed Description

Utilities for Z-value validation and layer management.

Enumeration Type Documentation

◆ Layer

enum class ZValueLayerManager::Layer
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.

Function Documentation

◆ isOverlayZValue()

bool ZValueLayerManager::isOverlayZValue ( qreal zValue)
nodiscardconstexpr

Validates that a Z-value is in the overlay layer.

Overlay elements should have Z-values at or above OVERLAY_BASE.

Parameters
zValueThe Z-value to validate
Returns
true if the Z-value is valid for an overlay element

◆ isValidCardZValue()

bool ZValueLayerManager::isValidCardZValue ( qreal zValue)
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.

Parameters
zValueThe Z-value to validate
Returns
true if the Z-value is valid for a card

◆ overlayZValue()

qreal ZValueLayerManager::overlayZValue ( qreal offset)
nodiscardconstexpr

Returns the Z-value for a specific overlay element.

Parameters
offsetOffset from OVERLAY_BASE (0-7 for current elements)
Returns
The absolute Z-value for the overlay element

Variable Documentation

◆ CARD_Z_VALUE_MAX

qreal ZValueLayerManager::CARD_Z_VALUE_MAX = 40000000.0
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.

◆ OVERLAY_BASE

qreal ZValueLayerManager::OVERLAY_BASE = 2000000000.0
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.