![]() |
Atlas Game Manager
A game manager for f95 and dlsite written in c++
|
#include <Game.hpp>
Signals | |
| void | dataChanged () |
Public Member Functions | |
| Game ()=default | |
| ~Game () | |
| Game (const RecordID id) | |
| Game & | operator= (const Game &other) |
| Game (const Game &other) | |
| bool | valid () const |
| Returns true if ptr points to valid game data. | |
| RecordID | id () const |
| Returns the record id for this game. | |
| void | setTitle (QString title) |
| Sets the title for the game. | |
| void | setCreator (QString creator) |
| Sets the creator for the game. | |
| void | setEngine (QString engine) |
| Sets the engine for the game. | |
| void | setDescription (QString description) |
| Sets a description to be used. | |
| bool | versionExists (const QString &str) |
| QPixmap | requestThumbnail (const BannerType type) |
| Get thumbnail from image. BLOCKING. | |
| void | addVersion (QString version_name, std::filesystem::path dir, std::filesystem::path executable, const std::uint64_t folder_size, const bool in_place) |
| Adds a new version. Will throw if version of same name exists. | |
| void | removeVersion (const Version &info) |
| Removes a version from Atlas. | |
| void | addPlaytime (const std::uint64_t seconds) |
| Adds playtime to the playtime counter. | |
| template<class Rep, class Period> | |
| void | addPlaytime (const std::chrono::duration< Rep, Period > time_diff) |
Template form of addPlaytime for taking in any chrono duration. | |
| void | setLastPlayed (const std::uint64_t) |
| Sets the last played timestamp. | |
| QFuture< QPixmap > | requestPreview (const std::uint64_t index, const bool use_thumbnail=false) const |
| Returns a future for the preview to be loaded. | |
| void | reorderPreviews (std::vector< std::filesystem::path > paths) |
| void | addPreview (std::filesystem::path path, std::uint64_t index=0) |
| If index is zero then it will place it at the highest possible postion (starting at 1) | |
| void | removePreview (const std::uint64_t index) |
| void | removePreview (const std::filesystem::path path) |
| QFuture< QPixmap > | preview (const std::uint64_t index, const bool use_thumbnail=false) |
| QFuture< QPixmap > | scaledPreview (const QSize size, const SCALE_TYPE scale_type, const std::uint64_t index, const bool use_thumbnail=false) |
| void | addUserTag (QString str) |
| void | removeUserTag (QString str) |
| void | setBanner (std::filesystem::path path, const BannerType type) |
| const std::filesystem::path | bannerPath (const BannerType type) const |
| QFuture< QPixmap > | requestBanner (const BannerType type, const bool use_thumbnail=false) const |
| QFuture< QPixmap > | requestBanner (const int width, const int height, const SCALE_TYPE scale_type, const BannerType type, const bool use_thumbnail=false) |
| Simple passthrough to same function but with combined size via QSize instead of seperate ints. | |
| QFuture< QPixmap > | requestBanner (const QSize size, const SCALE_TYPE scale_type, const BannerType type, const bool use_thumbnail=false) |
| bool | hasBanner (const BannerType type) const |
| void | connectAtlasData (const AtlasID id) |
| Connects this record to a atlas_data mapping. | |
| void | connectF95Data (const F95ID id) |
| const GameData * | operator-> () const |
| Used to accessing internal GameData as a const data member. | |
| bool | hasVersion (const QString str) const |
| Version & | operator[] (const QString str) const |
Private Attributes | |
| std::shared_ptr< GameData > | ptr { nullptr } |
| RecordID | m_id { INVALID_RECORD_ID } |
|
default |
| atlas::records::Game::~Game | ( | ) |
|
explicit |
|
inline |
|
inline |
Template form of addPlaytime for taking in any chrono duration.
| void atlas::records::Game::addPlaytime | ( | const std::uint64_t | seconds | ) |
Adds playtime to the playtime counter.
| void atlas::records::Game::addPreview | ( | std::filesystem::path | path, |
| std::uint64_t | index = 0 ) |
If index is zero then it will place it at the highest possible postion (starting at 1)
| void atlas::records::Game::addUserTag | ( | QString | str | ) |
| void atlas::records::Game::addVersion | ( | QString | version_name, |
| std::filesystem::path | dir, | ||
| std::filesystem::path | executable, | ||
| const std::uint64_t | folder_size, | ||
| const bool | in_place ) |
Adds a new version. Will throw if version of same name exists.
| dir | |
| executable | Must be a relative path sourced from dir. |
| const std::filesystem::path atlas::records::Game::bannerPath | ( | const BannerType | type | ) | const |
| void atlas::records::Game::connectAtlasData | ( | const AtlasID | id | ) |
Connects this record to a atlas_data mapping.
| void atlas::records::Game::connectF95Data | ( | const F95ID | id | ) |
|
signal |
| bool atlas::records::Game::hasBanner | ( | const BannerType | type | ) | const |
|
nodiscard |
|
inlinenodiscard |
Returns the record id for this game.
|
inlinenodiscard |
Used to accessing internal GameData as a const data member.
|
nodiscard |
|
nodiscard |
| void atlas::records::Game::removePreview | ( | const std::filesystem::path | path | ) |
| void atlas::records::Game::removePreview | ( | const std::uint64_t | index | ) |
| void atlas::records::Game::removeUserTag | ( | QString | str | ) |
| void atlas::records::Game::removeVersion | ( | const Version & | info | ) |
Removes a version from Atlas.
| info |
| void atlas::records::Game::reorderPreviews | ( | std::vector< std::filesystem::path > | paths | ) |
|
nodiscard |
|
nodiscard |
Simple passthrough to same function but with combined size via QSize instead of seperate ints.
|
nodiscard |
|
nodiscard |
Returns a future for the preview to be loaded.
| QPixmap atlas::records::Game::requestThumbnail | ( | const BannerType | type | ) |
Get thumbnail from image. BLOCKING.
|
nodiscard |
| void atlas::records::Game::setBanner | ( | std::filesystem::path | path, |
| const BannerType | type ) |
| void atlas::records::Game::setCreator | ( | QString | creator | ) |
Sets the creator for the game.
| void atlas::records::Game::setDescription | ( | QString | description | ) |
Sets a description to be used.
| void atlas::records::Game::setEngine | ( | QString | engine | ) |
Sets the engine for the game.
| void atlas::records::Game::setLastPlayed | ( | const std::uint64_t | time | ) |
Sets the last played timestamp.
| void atlas::records::Game::setTitle | ( | QString | title | ) |
Sets the title for the game.
|
inline |
Returns true if ptr points to valid game data.
| bool atlas::records::Game::versionExists | ( | const QString & | str | ) |
|
private |
|
private |