mirror of
https://github.com/rvtr/ctr_Repair.git
synced 2025-10-31 13:51:08 -04:00
進捗と結果を表示するように git-svn-id: file:///Volumes/Transfer/gigaleak_20231201/2020-05-23%20-%20ctr.7z%20+%20svn_v1.068.zip/ctr/svn/ctr_Repair@654 385bec56-5757-e545-9c3a-d8741f4650f1
78 lines
2.3 KiB
C++
78 lines
2.3 KiB
C++
/*---------------------------------------------------------------------------*
|
|
Project: Horizon
|
|
File: StateManager.h
|
|
|
|
Copyright 2009-2011 Nintendo. All rights reserved.
|
|
|
|
These coded instructions, statements, and computer programs contain
|
|
proprietary information of Nintendo of America Inc. and/or Nintendo
|
|
Company Ltd., and are protected by Federal copyright law. They may
|
|
not be disclosed to third parties or copied or duplicated in any form,
|
|
in whole or in part, without the prior written consent of Nintendo.
|
|
|
|
$Rev$
|
|
*---------------------------------------------------------------------------*/
|
|
|
|
#ifndef STATEMANAGER_H_
|
|
#define STATEMANAGER_H_
|
|
|
|
#include <nn.h>
|
|
#include <scene.h>
|
|
|
|
|
|
|
|
//! @brief 進捗状態を管理します
|
|
class StateManager
|
|
{
|
|
enum State
|
|
{
|
|
STATE_START, // 起動直後
|
|
STATE_CONFIRM_OVERWRITE, // セーブデータを上書きしても良いか確認
|
|
STATE_OVERWRITING, // アップデート中
|
|
STATE_SETTING_IMPORT, // 書き込み開始
|
|
STATE_SETTING_IMPORTING, // 設定書き込み中
|
|
STATE_DONE, // 完了
|
|
STATE_ERROR, // エラー
|
|
|
|
STATE_NUM_MAX //
|
|
};
|
|
|
|
|
|
public:
|
|
enum Mode
|
|
{
|
|
MODE_OVERWITE, // セーブデータ上書き
|
|
MODE_APPLY, // セーブデータ反映
|
|
|
|
MODE_NUM_MAX
|
|
};
|
|
|
|
public:
|
|
//! @param[in] mode MODE_OVERWRITE, MODE_APPLYのいずれかを引数にとり、</br>
|
|
//! セーブデータ上書きモードかセーブデータ反映モードで動作します
|
|
StateManager(Mode mode);
|
|
virtual ~StateManager();
|
|
|
|
//! @brief 現状態に合わせて処理を実行します
|
|
//! @param[in] goNext 外部入力によって次の状態に遷移するか判断するために使われます
|
|
//! @param[in] pTextWriter 文字表示に使用されます
|
|
//! @return 次の状態に遷移してもよいかどうか
|
|
bool Exec(bool goNext, scene::TextWriter* pTextWriter);
|
|
|
|
//! @brief 次の状態に遷移します
|
|
void GoNext();
|
|
//! @brief 処理が完了したかどうか
|
|
bool IsFinished();
|
|
//! @brief エラーが発生したかどうか
|
|
bool IsError();
|
|
|
|
private:
|
|
void DrawBusyIcon(scene::TextWriter* pTextWriter);
|
|
Mode m_Mode;
|
|
State m_State;
|
|
NN_PADDING2;
|
|
u32 m_Counter;
|
|
};
|
|
|
|
#endif /* STATEMANAGER_H_ */
|