Cockatrice 2026-09-01-Development-3.1.0-beta.10
A virtual tabletop for multiplayer card games
Loading...
Searching...
No Matches
playmat_params.h
Go to the documentation of this file.
1#ifndef COCKATRICE_PLAYMAT_PARAMS_H
2#define COCKATRICE_PLAYMAT_PARAMS_H
3
4#include "card_ref.h"
5
6#include <cmath>
7
18{
19 double marginPctL = 0.07;
20 double marginPctR = 0.07;
21 double verticalOffset = 0.33;
22 double zoom = 1.0;
23
24 bool operator==(const PlaymatParams &other) const
25 {
26 return qFuzzyCompare(marginPctL, other.marginPctL) && qFuzzyCompare(marginPctR, other.marginPctR) &&
27 qFuzzyCompare(verticalOffset, other.verticalOffset) && qFuzzyCompare(zoom, other.zoom);
28 }
29
30 bool operator!=(const PlaymatParams &other) const
31 {
32 return !(*this == other);
33 }
34};
35
42{
45
46 bool operator==(const PlaymatInfo &other) const
47 {
48 return card == other.card && params == other.params;
49 }
50};
51
52#endif // COCKATRICE_PLAYMAT_PARAMS_H
Definition card_ref.h:14
A resolved playmat (card + positioning parameters).
Definition playmat_params.h:42
PlaymatParams params
Positioning parameters for the playmat card image.
Definition playmat_params.h:44
CardRef card
The card whose art is used as playmat.
Definition playmat_params.h:43
bool operator==(const PlaymatInfo &other) const
Definition playmat_params.h:46
Positioning parameters for a playmat card image.
Definition playmat_params.h:18
double marginPctL
Left margin as fraction of card width (0.0–0.95).
Definition playmat_params.h:19
double marginPctR
Right margin as fraction of card width (0.0–0.95).
Definition playmat_params.h:20
bool operator==(const PlaymatParams &other) const
Definition playmat_params.h:24
double verticalOffset
Vertical position within card (0.0=top, 1.0=bottom).
Definition playmat_params.h:21
bool operator!=(const PlaymatParams &other) const
Definition playmat_params.h:30
double zoom
Scale factor (0.1–4.0).
Definition playmat_params.h:22