OROCHI
 
Loading...
Searching...
No Matches
GxPadRecorder.h
Go to the documentation of this file.
1//===========================================================================
10//===========================================================================
11#pragma once
12
13GX_CORE_NAMESPACE_BEGIN()
14
16
17//===========================================================================
19//===========================================================================
21{
22 //-----------------------------------------------------------
24 //-----------------------------------------------------------
26public:
27 // RTTI定義
28 GX_RTTI_CLASS(GxPadRecorder, GxClassBase)
29 // ClassBase継承クラス用禁止宣言
31
32
33 static constexpr u32 RECORD_PLAYER_MAX = 8;
35 static constexpr u32 RECORD_PLAYER_MIN = 1;
37 static constexpr u32 RECORD_FRAME_MAX = 60 * 60 * 60;
38
41 {
42 PAD_RECORDER_FLAG_PRINT_TTY = (1 << 0),
43 PAD_RECORDER_FLAG_AUTO_SAVE = (1 << 1)
44 };
45
47 //-----------------------------------------------------------
49 //-----------------------------------------------------------
51public:
53 GxPadRecorder(void);
55 ~GxPadRecorder(void) override;
56
58 void initializeRecording(GxResPadRecorder* pResource, u32 playerNum = RECORD_PLAYER_MIN, u32 frame = 0, u32 randSeed = 0, u32 flag = 0);
60 void initializePlaying(GxResPadRecorder* pResource, u32 frame = 0, u32 flag = 0);
62 void terminate(void);
63
65 //-----------------------------------------------------------
67 //-----------------------------------------------------------
69public:
71 b32 recordData(const GxPad::GxInputData& src, u32 player = 0);
72
74 b32 playData(GxPad::GxInputData& dst, u32 player = 0);
75
76protected:
78 void autoSavePadData(void);
79#if GX_DEVELOP
81 void printPadData(const GxPad::GxInputData& input, u32 player);
82#endif // GX_DEVELOP
83
85 //-----------------------------------------------------------
87 //-----------------------------------------------------------
89public:
91 constexpr GxResPadRecorder* getResource(void) const { return _pResource; }
93 GX_FORCE_INLINE b32 isInitialized(void) const { return _isInitialized; }
95 GX_FORCE_INLINE b32 isEnd(u32 player) const { return (_currentFrame[player] >= _endFrame); }
96
98 //-----------------------------------------------------------
100 //-----------------------------------------------------------
102protected:
105 u32 _currentFrame[RECORD_PLAYER_MAX];
106 u32 _flag;
108
110};
111
112GX_CORE_NAMESPACE_END()
#define GX_PROHIBIT_CLASS_BASE(__CLASS__)
GxClassBase継承の禁止宣言
Definition GxBase.h:240
オブジェクト基底クラス
Definition GxBase.h:88
入力パッドレコーダー処理クラス
Definition GxPadRecorder.h:21
PAD_RECORDER_FLAG
フラグ定義
Definition GxPadRecorder.h:41
GX_FORCE_INLINE b32 isInitialized(void) const
初期化済み判定
Definition GxPadRecorder.h:93
GX_FORCE_INLINE b32 isEnd(u32 player) const
終了判定
Definition GxPadRecorder.h:95
b32 _isInitialized
初期化済みフラグ
Definition GxPadRecorder.h:103
u32 _endFrame
終端フレーム
Definition GxPadRecorder.h:107
u32 _flag
フラグ
Definition GxPadRecorder.h:106
constexpr GxResPadRecorder * getResource(void) const
リソースポインタ取得
Definition GxPadRecorder.h:91
GxResPadRecorder * _pResource
リソースポインタ
Definition GxPadRecorder.h:104
入力パッドレコーダーリソースクラス
Definition GxResPadRecorder.h:19
入力情報
Definition GxInputPad.h:114
32bitブーリアン
Definition GxDefine.h:173