Pokered Save Editor 2
Pokemon Red & Blue save file editor - Qt 6 C++/QML
Loading...
Searching...
No Matches
NamesPlayer Class Reference

Random player-name source (an AbstractRandomString of player names). More...

#include <namesplayer.h>

Inheritance diagram for NamesPlayer:
Collaboration diagram for NamesPlayer:

Static Public Member Functions

static NamesPlayerinst ()
 The process-wide NamesPlayer singleton.

Protected Member Functions

 NamesPlayer ()
 Private – use inst(); loads the player-names asset.
virtual void qmlRegister () const
 Register NamesPlayer with QML.
Protected Member Functions inherited from AbstractRandomString
 AbstractRandomString (const QString fileName)

Additional Inherited Members

Public Member Functions inherited from AbstractRandomString
const QVector< QString > getStore () const
 All strings.
int getStoreSize () const
 String count.
const QString getStoreAt (const int ind) const
 String at ind (for QML).
QString randomExample ()
 A random string from the list.
void load ()
 Load the strings from fileName.
void qmlProtect (const QQmlEngine *const engine) const
 Pin to C++ ownership.
Protected Attributes inherited from AbstractRandomString
 : void listChanged()
 < Number of strings.
QVector< QString > store
 The loaded strings.
const QString fileName
 Asset path (set by the subclass).

Detailed Description

Random player-name source (an AbstractRandomString of player names).

All behaviour is inherited; this just provides the singleton + QML registration. Backs db.names.player and the player-name randomizer.

See also
AbstractRandomString, Names.

Definition at line 33 of file namesplayer.h.

Constructor & Destructor Documentation

◆ NamesPlayer()

NamesPlayer::NamesPlayer ( )
protected

Private – use inst(); loads the player-names asset.

Definition at line 42 of file namesplayer.cpp.

References AbstractRandomString::AbstractRandomString(), and qmlRegister().

Referenced by inst().

Member Function Documentation

◆ inst()

NamesPlayer * NamesPlayer::inst ( )
static

The process-wide NamesPlayer singleton.

Definition at line 48 of file namesplayer.cpp.

References NamesPlayer().

Referenced by Names::player(), and Names::qmlProtect().

◆ qmlRegister()

void NamesPlayer::qmlRegister ( ) const
protectedvirtual

Register NamesPlayer with QML.

Implements AbstractRandomString.

Definition at line 32 of file namesplayer.cpp.

Referenced by NamesPlayer().


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