|
wavelength 1.0.0
|
Front end of the memory card work. More...
#include <mcmanager.h>
Public Member Functions | |
| MCManager () | |
| Construct a manager with no task running. | |
| void | Init () |
| Read the memory card configuration and build the tasks. | |
| void | Terminate () |
| Destroy the tasks Init() built, and release the configuration buffers. | |
| void | InitialCheck (MemcardUser *pUser, int nSlot) |
| Start checking a card at startup. | |
| void | GetCardStatus (MemcardUser *pUser, int nSlot) |
| Start learning whether a usable card is in a slot. | |
| void | SaveFreq (MemcardUser *pUser, int nSlot, Campaign *pProfile, const char *pszOldName, int nOverwrite) |
| Start saving the Freq of a profile. | |
| void | LoadFreqs (MemcardUser *pUser, int nSlot) |
| Start loading every saved Freq into mProfiles. | |
| void | DeleteFreq (MemcardUser *pUser, int nSlot, const char *pszName) |
| Start deleting a saved Freq. | |
| void | SaveRemix (MemcardUser *pUser, int nSlot, RemixInfo *pInfo, const void *pData, int nOverwrite) |
| Start saving a remix. | |
| void | LoadRemix (MemcardUser *pUser, int nSlot, const char *pszName, void *pBuffer, int nSize) |
| Start loading a saved remix. | |
| void | ListRemixes (MemcardUser *pUser, int nSlot) |
| Start reading the descriptions of the saved remixes into mRemixInfos. | |
| void | DeleteRemix (MemcardUser *pUser, int nSlot, const char *pszName) |
| Start deleting a saved remix. | |
| void | SaveSettings (MemcardUser *pUser, int nSlot, GameOptions *pSettings, int nOverwrite) |
| Start saving the settings. | |
| void | LoadSettings (MemcardUser *pUser, int nSlot) |
| Start loading the settings into mSettings. | |
| void | ListNetConfigs (MemcardUser *pUser, int nSlot) |
| Start listing the network configurations. | |
| void | FormatCard (MemcardUser *pUser, int nSlot) |
| Start formatting an unformatted card. | |
| void | SaveFile (MemcardUser *pUser, int nSlot, const char *pszName, const void *pData, int nSize, bool bReserved) |
| Start saving a block of memory to a file. | |
| void | Poll () |
| Report the end of the running task to its user, and stop the task. | |
| const char * | GetSlotName (int nSlot) |
| Report the localised name of a memory card slot. | |
| const std::vector< Campaign > & | GetProfiles () const |
| const std::vector< RemixInfo > & | GetRemixInfos () const |
| const GameOptions & | GetSettings () const |
Front end of the memory card work.
It runs one piece of work at a time on behalf of a MemcardUser.
The class is not polymorphic and has no RTTI. The name is inferred from the tasks it runs. The object is 0x90 bytes. Each starting routine prepares one task and makes it the running task. Poll() reports the end of the running task to its user through the MemcardUser method for the task, together with the results the manager retains.
|
inline |
Construct a manager with no task running.
The task objects are built by Init().
| void MCManager::Init | ( | ) |
Read the memory card configuration and build the tasks.
Metagame::Init() calls it.
| void MCManager::Terminate | ( | ) |
Destroy the tasks Init() built, and release the configuration buffers.
| void MCManager::InitialCheck | ( | MemcardUser * | pUser, |
| int | nSlot ) |
Start checking a card at startup.
MemcardUser::OnInitialCheck() learns the outcome.
| pUser | The user to report to. |
| nSlot | The memory card slot. |
| void MCManager::GetCardStatus | ( | MemcardUser * | pUser, |
| int | nSlot ) |
Start learning whether a usable card is in a slot.
MemcardUser::OnCardStatus() learns the outcome.
| pUser | The user to report to. |
| nSlot | The memory card slot. |
| void MCManager::SaveFreq | ( | MemcardUser * | pUser, |
| int | nSlot, | ||
| Campaign * | pProfile, | ||
| const char * | pszOldName, | ||
| int | nOverwrite ) |
Start saving the Freq of a profile.
MemcardUser::OnFreqSaved() learns the outcome.
| pUser | The user to report to. |
| nSlot | The memory card slot. |
| pProfile | The profile, saved under its name. |
| pszOldName | The name the Freq was saved under before. A different name has its file deleted. |
| nOverwrite | Non-zero when a saved Freq of the name may be replaced. |
| void MCManager::LoadFreqs | ( | MemcardUser * | pUser, |
| int | nSlot ) |
Start loading every saved Freq into mProfiles.
MemcardUser::OnFreqsLoaded() learns the outcome.
| pUser | The user to report to. |
| nSlot | The memory card slot. |
| void MCManager::DeleteFreq | ( | MemcardUser * | pUser, |
| int | nSlot, | ||
| const char * | pszName ) |
Start deleting a saved Freq.
MemcardUser::OnFreqDeleted() learns the outcome.
| pUser | The user to report to. |
| nSlot | The memory card slot. |
| pszName | The Freq's name. |
| void MCManager::SaveRemix | ( | MemcardUser * | pUser, |
| int | nSlot, | ||
| RemixInfo * | pInfo, | ||
| const void * | pData, | ||
| int | nOverwrite ) |
Start saving a remix.
MemcardUser::OnRemixSaved() learns the outcome.
| pUser | The user to report to. |
| nSlot | The memory card slot. |
| pInfo | The description of the remix. Its name and size are those of the file and of the remix. |
| pData | The remix. |
| nOverwrite | Non-zero when a saved remix of the name may be replaced. |
| void MCManager::LoadRemix | ( | MemcardUser * | pUser, |
| int | nSlot, | ||
| const char * | pszName, | ||
| void * | pBuffer, | ||
| int | nSize ) |
Start loading a saved remix.
MemcardUser::OnRemixLoaded() learns the outcome.
| pUser | The user to report to. |
| nSlot | The memory card slot. |
| pszName | The name of the remix. |
| pBuffer | Receives the remix. The caller retains it. |
| nSize | The number of bytes to read. |
| void MCManager::ListRemixes | ( | MemcardUser * | pUser, |
| int | nSlot ) |
Start reading the descriptions of the saved remixes into mRemixInfos.
MemcardUser::OnRemixesListed() learns the outcome.
| pUser | The user to report to. |
| nSlot | The memory card slot. |
| void MCManager::DeleteRemix | ( | MemcardUser * | pUser, |
| int | nSlot, | ||
| const char * | pszName ) |
Start deleting a saved remix.
MemcardUser::OnRemixDeleted() learns the outcome.
| pUser | The user to report to. |
| nSlot | The memory card slot. |
| pszName | The name of the remix. |
| void MCManager::SaveSettings | ( | MemcardUser * | pUser, |
| int | nSlot, | ||
| GameOptions * | pSettings, | ||
| int | nOverwrite ) |
Start saving the settings.
MemcardUser::OnSettingsSaved() learns the outcome.
| pUser | The user to report to. |
| nSlot | The memory card slot. |
| pSettings | The settings. |
| nOverwrite | Non-zero when saved settings may be replaced. |
| void MCManager::LoadSettings | ( | MemcardUser * | pUser, |
| int | nSlot ) |
Start loading the settings into mSettings.
MemcardUser::OnSettingsLoaded() learns the outcome.
| pUser | The user to report to. |
| nSlot | The memory card slot. |
| void MCManager::ListNetConfigs | ( | MemcardUser * | pUser, |
| int | nSlot ) |
Start listing the network configurations.
MemcardUser::OnNetConfigsListed() learns the outcome.
| pUser | The user to report to. |
| nSlot | The memory card slot. |
| void MCManager::FormatCard | ( | MemcardUser * | pUser, |
| int | nSlot ) |
Start formatting an unformatted card.
MemcardUser::OnCardFormatted() learns the outcome.
| pUser | The user to report to. |
| nSlot | The memory card slot. |
| void MCManager::SaveFile | ( | MemcardUser * | pUser, |
| int | nSlot, | ||
| const char * | pszName, | ||
| const void * | pData, | ||
| int | nSize, | ||
| bool | bReserved ) |
Start saving a block of memory to a file.
MemcardUser::OnFileSaved() learns the outcome.
| pUser | The user to report to. |
| nSlot | The memory card slot. |
| pszName | The name of the file. |
| pData | The data. |
| nSize | The number of bytes. |
| bReserved | Passed by every caller. The body does not read it. |
| void MCManager::Poll | ( | ) |
Report the end of the running task to its user, and stop the task.
Metagame::Update() calls it every frame. A running task that none of the tasks matches is reported as ERROR: bad task!!!.
| const char * MCManager::GetSlotName | ( | int | nSlot | ) |
Report the localised name of a memory card slot.
| nSlot | The memory card slot. |
|
inline |
|
inline |
|
inline |