JustAnotherDnDGame 0.1.0
Jeu de rôle tactique au d20, vue de dessus, en C++/Qt
Loading...
Searching...
No Matches
PlaneFileNaming.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2026 Valentin Eloy
2// SPDX-License-Identifier: GPL-3.0-or-later
3
4#pragma once
5
6#include <string>
7#include <vector>
8
19
20namespace hmi {
21
23inline const std::string PLANE_FILE_EXTENSION = ".png";
24
38 int width = 0;
39 int height = 0;
40
41 [[nodiscard]] friend bool operator==(const PlanePixelSize&,
42 const PlanePixelSize&) noexcept = default;
43};
44
46[[nodiscard]] PlanePixelSize planePixelSize(int widthUnits, int heightUnits,
47 int pixelsPerUnit) noexcept;
48
60[[nodiscard]] std::string uniquePlaneFileName(const std::string& levelName,
61 const std::vector<std::string>& existing);
62
73[[nodiscard]] std::string sanitizePlaneBaseName(const std::string& name);
74
75} // namespace hmi
Definition AudioEngine.cpp:15
std::string sanitizePlaneBaseName(const std::string &name)
Réduit un nom libre à ce qu'un nom de fichier de plan accepte.
Definition PlaneFileNaming.cpp:31
const std::string PLANE_FILE_EXTENSION
Extension des fichiers de plan. Un plan est une image, toujours écrite en PNG.
Definition PlaneFileNaming.h:23
PlanePixelSize planePixelSize(int widthUnits, int heightUnits, int pixelsPerUnit) noexcept
Dimensions, en pixels, du PNG d'un plan.
Definition PlaneFileNaming.cpp:23
std::string uniquePlaneFileName(const std::string &levelName, const std::vector< std::string > &existing)
Compose un nom de fichier de plan unique pour un niveau donné.
Definition PlaneFileNaming.cpp:60
Dimensions, en pixels, du PNG d'un plan.
Definition PlaneFileNaming.h:37
friend bool operator==(const PlanePixelSize &, const PlanePixelSize &) noexcept=default
int height
Definition PlaneFileNaming.h:39
int width
Definition PlaneFileNaming.h:38