Cockatrice
2026-10-19-Development-3.1.2-beta.2
A virtual tabletop for multiplayer card games
Toggle main menu visibility
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
17
struct
PlaymatParams
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
41
struct
PlaymatInfo
42
{
43
CardRef
card
;
44
PlaymatParams
params
;
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
card_ref.h
CardRef
Definition
card_ref.h:14
PlaymatInfo
A resolved playmat (card + positioning parameters).
Definition
playmat_params.h:42
PlaymatInfo::params
PlaymatParams params
Positioning parameters for the playmat card image.
Definition
playmat_params.h:44
PlaymatInfo::card
CardRef card
The card whose art is used as playmat.
Definition
playmat_params.h:43
PlaymatInfo::operator==
bool operator==(const PlaymatInfo &other) const
Definition
playmat_params.h:46
PlaymatParams
Positioning parameters for a playmat card image.
Definition
playmat_params.h:18
PlaymatParams::marginPctL
double marginPctL
Left margin as fraction of card width (0.0–0.95).
Definition
playmat_params.h:19
PlaymatParams::marginPctR
double marginPctR
Right margin as fraction of card width (0.0–0.95).
Definition
playmat_params.h:20
PlaymatParams::operator==
bool operator==(const PlaymatParams &other) const
Definition
playmat_params.h:24
PlaymatParams::verticalOffset
double verticalOffset
Vertical position within card (0.0=top, 1.0=bottom).
Definition
playmat_params.h:21
PlaymatParams::operator!=
bool operator!=(const PlaymatParams &other) const
Definition
playmat_params.h:30
PlaymatParams::zoom
double zoom
Scale factor (0.1–4.0).
Definition
playmat_params.h:22
libcockatrice_utility
libcockatrice
utility
playmat_params.h
Generated by
1.18.0