Atlas Game Manager
A game manager for f95 and dlsite written in c++
Loading...
Searching...
No Matches
atlas::records::Game Class Referencefinal

#include <Game.hpp>

Inheritance diagram for atlas::records::Game:

Signals

void dataChanged ()
 

Public Member Functions

 Game ()=default
 
 ~Game ()
 
 Game (const RecordID id)
 
Gameoperator= (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 GameDataoperator-> () const
 Used to accessing internal GameData as a const data member.
 
bool hasVersion (const QString str) const
 
Versionoperator[] (const QString str) const
 

Private Attributes

std::shared_ptr< GameDataptr { nullptr }
 
RecordID m_id { INVALID_RECORD_ID }
 

Constructor & Destructor Documentation

◆ Game() [1/3]

atlas::records::Game::Game ( )
default

◆ ~Game()

atlas::records::Game::~Game ( )

◆ Game() [2/3]

atlas::records::Game::Game ( const RecordID id)
explicit

◆ Game() [3/3]

atlas::records::Game::Game ( const Game & other)
inline

Member Function Documentation

◆ addPlaytime() [1/2]

template<class Rep, class Period>
void atlas::records::Game::addPlaytime ( const std::chrono::duration< Rep, Period > time_diff)
inline

Template form of addPlaytime for taking in any chrono duration.

◆ addPlaytime() [2/2]

void atlas::records::Game::addPlaytime ( const std::uint64_t seconds)

Adds playtime to the playtime counter.

◆ addPreview()

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)

◆ addUserTag()

void atlas::records::Game::addUserTag ( QString str)

◆ addVersion()

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.

Note
No files are moved during this process. Any file movement must take place BEFORE this function is called.
Parameters
dir
executableMust be a relative path sourced from dir.

◆ bannerPath()

const std::filesystem::path atlas::records::Game::bannerPath ( const BannerType type) const

◆ connectAtlasData()

void atlas::records::Game::connectAtlasData ( const AtlasID id)

Connects this record to a atlas_data mapping.

◆ connectF95Data()

void atlas::records::Game::connectF95Data ( const F95ID id)

◆ dataChanged

void atlas::records::Game::dataChanged ( )
signal

◆ hasBanner()

bool atlas::records::Game::hasBanner ( const BannerType type) const

◆ hasVersion()

bool atlas::records::Game::hasVersion ( const QString str) const
nodiscard

◆ id()

RecordID atlas::records::Game::id ( ) const
inlinenodiscard

Returns the record id for this game.

◆ operator->()

const GameData * atlas::records::Game::operator-> ( ) const
inlinenodiscard

Used to accessing internal GameData as a const data member.

◆ operator=()

Game & atlas::records::Game::operator= ( const Game & other)
inline

◆ operator[]()

Version & atlas::records::Game::operator[] ( const QString str) const
nodiscard

◆ preview()

QFuture< QPixmap > atlas::records::Game::preview ( const std::uint64_t index,
const bool use_thumbnail = false )
nodiscard

◆ removePreview() [1/2]

void atlas::records::Game::removePreview ( const std::filesystem::path path)

◆ removePreview() [2/2]

void atlas::records::Game::removePreview ( const std::uint64_t index)

◆ removeUserTag()

void atlas::records::Game::removeUserTag ( QString str)

◆ removeVersion()

void atlas::records::Game::removeVersion ( const Version & info)

Removes a version from Atlas.

Warning
THIS WILL LEAVE FILES BEHIND. YOU MUST DELETE THEM YOURSELF
Parameters
info

◆ reorderPreviews()

void atlas::records::Game::reorderPreviews ( std::vector< std::filesystem::path > paths)

◆ requestBanner() [1/3]

QFuture< QPixmap > atlas::records::Game::requestBanner ( const BannerType type,
const bool use_thumbnail = false ) const
nodiscard

◆ requestBanner() [2/3]

QFuture< QPixmap > atlas::records::Game::requestBanner ( const int width,
const int height,
const SCALE_TYPE scale_type,
const BannerType type,
const bool use_thumbnail = false )
nodiscard

Simple passthrough to same function but with combined size via QSize instead of seperate ints.

◆ requestBanner() [3/3]

QFuture< QPixmap > atlas::records::Game::requestBanner ( const QSize size,
const SCALE_TYPE scale_type,
const BannerType type,
const bool use_thumbnail = false )
nodiscard

◆ requestPreview()

QFuture< QPixmap > atlas::records::Game::requestPreview ( const std::uint64_t index,
const bool use_thumbnail = false ) const
nodiscard

Returns a future for the preview to be loaded.

◆ requestThumbnail()

QPixmap atlas::records::Game::requestThumbnail ( const BannerType type)

Get thumbnail from image. BLOCKING.

◆ scaledPreview()

QFuture< QPixmap > atlas::records::Game::scaledPreview ( const QSize size,
const SCALE_TYPE scale_type,
const std::uint64_t index,
const bool use_thumbnail = false )
nodiscard

◆ setBanner()

void atlas::records::Game::setBanner ( std::filesystem::path path,
const BannerType type )

◆ setCreator()

void atlas::records::Game::setCreator ( QString creator)

Sets the creator for the game.

◆ setDescription()

void atlas::records::Game::setDescription ( QString description)

Sets a description to be used.

◆ setEngine()

void atlas::records::Game::setEngine ( QString engine)

Sets the engine for the game.

◆ setLastPlayed()

void atlas::records::Game::setLastPlayed ( const std::uint64_t time)

Sets the last played timestamp.

◆ setTitle()

void atlas::records::Game::setTitle ( QString title)

Sets the title for the game.

◆ valid()

bool atlas::records::Game::valid ( ) const
inline

Returns true if ptr points to valid game data.

◆ versionExists()

bool atlas::records::Game::versionExists ( const QString & str)

Member Data Documentation

◆ m_id

RecordID atlas::records::Game::m_id { INVALID_RECORD_ID }
private

◆ ptr

std::shared_ptr< GameData > atlas::records::Game::ptr { nullptr }
private

The documentation for this class was generated from the following files: