@@ -88,6 +88,56 @@ struct ZipData {
8888 * Initializes an empty instance of `ZipData`.
8989 */
9090 ZipData () {}
91+
92+ /* *
93+ * @brief This sets the file name metadata.
94+ * @param fileName TRLE level zip file name.
95+ */
96+ inline void setFileName (const QString& fileName) {
97+ }
98+
99+ /* *
100+ * @brief This sets the file size metadata.
101+ * @param size Size in MiB.
102+ */
103+ inline void setZise (const float size) {
104+ }
105+
106+ /* *
107+ * @brief This sets the file md5sum metadata.
108+ * @param md5sum Checksum of the archive.
109+ */
110+ inline void setMd5sum (const QString& md5sum) {
111+ }
112+
113+ /* *
114+ * @brief This sets the URL for the file.
115+ * @param url String of download address.
116+ */
117+ inline void setURL (const QString& url) {
118+ }
119+
120+ /* *
121+ * @brief This sets the zip file name metadata.
122+ * @param version File version from trcustoms.org
123+ */
124+ inline void setVersion (const qint64 version) {
125+ }
126+
127+ /* *
128+ * @brief This sets the zip file name metadata.
129+ * @param type Level type.
130+ */
131+ inline void setType (const qint64 type) {
132+ }
133+
134+ /* *
135+ * @brief This sets the zip file name metadata.
136+ * @param release date of file release.
137+ */
138+ inline void setRelease (const QString& release) {
139+ }
140+
91141 /* *
92142 * @brief Parameterized constructor for `ZipData`.
93143 *
@@ -126,6 +176,77 @@ struct ZipData {
126176 QString release; // /< The The date of file release from trcustoms.
127177};
128178
179+ /* *
180+ * @struct OriginalGameData
181+ * @brief Represents a Tomb Raider Game Entry Card Info.
182+ *
183+ * This struct is designed to store a Game data record.
184+ * Each record contains basic game data and a cover image displayed as a card in the application.
185+ */
186+ struct OriginalGameData {
187+ /* *
188+ * @brief Default constructor for `OriginalGameData`.
189+ *
190+ * Initializes an empty instance of `OriginalGameData`.
191+ */
192+ OriginalGameData () {}
193+
194+ /* *
195+ * @brief Parameterized constructor for `OriginalGameData`.
196+ *
197+ * This constructor initializes a `OriginalGameData` object with game metadata.
198+ *
199+ * @param id The numeric game datbase ID.
200+ * @param title The TRLE title. Expected to contain a single name.
201+ * @param shortBody some short game info text.
202+ * @param type The TRLE type, represented by a numeric ID.
203+ * @param releaseDate The release date in the format "YYYY-MM-DD" (e.g., "2000-01-01").
204+ * @param m_cover The cover image as a `m_cover`.
205+ */
206+ OriginalGameData (
207+ qint64 id, const QString& title, const QString& shortBody,
208+ qint64 type, const QString& releaseDate, const QPixmap& cover) :
209+ m_game_id (id), m_title(title), m_shortBody(shortBody), m_type(type),
210+ m_releaseDate (releaseDate) {
211+ // Define target dimensions and maintain aspect ratio
212+ QSize targetSize (640 , 480 );
213+ QSize newSize = cover.size ().scaled (targetSize, Qt::KeepAspectRatio);
214+
215+ // Scale the pixmap
216+ QPixmap scaledPixmap = cover.scaled (
217+ newSize,
218+ Qt::KeepAspectRatio,
219+ Qt::SmoothTransformation);
220+
221+ // Create a centered pixmap with a transparent background
222+ QPixmap centeredPixmap (targetSize);
223+ // Ensure a transparent background
224+ centeredPixmap.fill (Qt::transparent);
225+
226+ // Calculate offsets for centering the scaled image
227+ qint64 xOffset = (targetSize.width () - newSize.width ()) / 2 ;
228+ qint64 yOffset = (targetSize.height () - newSize.height ()) / 2 ;
229+
230+ // Draw the scaled image onto the centered pixmap
231+ QPainter painter (¢eredPixmap);
232+ painter.setRenderHint (QPainter::Antialiasing, true );
233+ painter.setRenderHint (QPainter::SmoothPixmapTransform, true );
234+ painter.drawPixmap (xOffset, yOffset, scaledPixmap);
235+ painter.end ();
236+
237+ // Store the resulting pixmap in m_picture
238+ m_cover = centeredPixmap;
239+ }
240+
241+ // Data members
242+ qint64 m_game_id; // /< The Game id.
243+ QString m_title; // /< The Game title.
244+ QString m_shortBody; // /< The Game info text.
245+ qint64 m_type; // /< ID of the type of game.
246+ QString m_releaseDate; // /< The release date in "YYYY-MM-DD" format.
247+ QPixmap m_cover; // /< The Game cover image.
248+ };
249+
129250/* *
130251 * @struct ListItemData
131252 * @brief Represents a Tomb Raider Level Entry Card Info.
@@ -175,7 +296,7 @@ struct ListItemData {
175296 QSize newSize = pixmap.size ().scaled (targetSize, Qt::KeepAspectRatio);
176297
177298 // Scale the pixmap
178- QPixmap scaledPixmap = pixmap.scaled (
299+ QPixmap scaledCover = pixmap.scaled (
179300 newSize,
180301 Qt::KeepAspectRatio,
181302 Qt::SmoothTransformation);
@@ -193,7 +314,7 @@ struct ListItemData {
193314 QPainter painter (¢eredPixmap);
194315 painter.setRenderHint (QPainter::Antialiasing, true );
195316 painter.setRenderHint (QPainter::SmoothPixmapTransform, true );
196- painter.drawPixmap (xOffset, yOffset, scaledPixmap );
317+ painter.drawPixmap (xOffset, yOffset, scaledCover );
197318 painter.end ();
198319
199320 // Store the resulting pixmap in m_picture
@@ -208,7 +329,7 @@ struct ListItemData {
208329 QString m_releaseDate; // /< The release date in "YYYY-MM-DD" format.
209330 qint64 m_difficulty; // /< ID of the difficulty of the level.
210331 qint64 m_duration; // /< ID of the estimated duration of the level.
211- QPixmap m_cover; // /< The TRLE cover image pointer .
332+ QPixmap m_cover; // /< The TRLE cover image.
212333};
213334
214335/* *
0 commit comments