OROCHI
 
Loading...
Searching...
No Matches
GxResActionPlanning.h
Go to the documentation of this file.
1//===========================================================================
9//===========================================================================
10#pragma once
11
12GX_CHARACTER_NAMESPACE_BEGIN()
13
14//===========================================================================
16//===========================================================================
18{
19 //-----------------------------------------------------------
21 //-----------------------------------------------------------
23public:
24 // RTTI宣言
25 GX_RTTI_RESOURCE_NAME(GxResActionPlanning, GxResBase, "連続アクションリソース")
26 // GxClassBaseReference継承クラス用禁止宣言
28
29
30 static constexpr u32 INVALID_ACT = 0xffffffff;
32 static constexpr s32 INVALID_ID = -1;
34 static constexpr u32 PLAN_SET_MAX = 8;
36 static constexpr u32 PLAN_MAX = 8;
38 static constexpr u32 NUM_ATTRIBUTE = 2;
39
41 struct GxHeader
42 {
45 };
48 {
49 s32 _id;
51 };
60
62 //-----------------------------------------------------------
64 //-----------------------------------------------------------
66
70 void cleanup(void) override;
71
73 //-------------------------------------------------------------
75 //-------------------------------------------------------------
77protected:
79 b32 load(GxStream& stream, u32 dataSize);
80#if GX_DEVELOP
82 b32 save(GxStream&);
83#endif // GX_DEVELOP
84public:
85#if GX_EDITOR
87 void getToolRtti( GxArray& arrayTool ) const override;
88#endif // GX_EDITOR
89
91 //-------------------------------------------------------------
93 //-------------------------------------------------------------
95
97 GX_FORCE_INLINE GxHeader* getHeader(void) const { return reinterpret_cast<GxHeader*>(_pBuffer); }
99 u32 getPlanSetIndex(s32 id) const;
101 GX_FORCE_INLINE u32 getPlanSetNum(void) const {return getHeader()->_numPlanSet;}
103 GX_FORCE_INLINE GxPlanSetParam* getPlanSet(u32 planSetIndex) const {return reinterpret_cast<GxPlanSetParam*>(_pBuffer + getPlanSetOffset(planSetIndex));}
105 GX_FORCE_INLINE GxPlanParam* getPlan(u32 planSetIndex, u32 planIndex) const {return reinterpret_cast<GxPlanParam*>(reinterpret_cast<GX_CHAR*>(getPlanSet(planSetIndex)) + getPlanOffset(planSetIndex, planIndex));}
106
107private:
109 GX_FORCE_INLINE u32 getPlanSetOffset(u32 planSetIndex) const { return *(reinterpret_cast<u32*>(_pBuffer) + 2 + planSetIndex) ; }
111 GX_FORCE_INLINE u32 getPlanOffset(u32 planSetIndex, u32 planIndex) const { return *(reinterpret_cast<u32*>(getPlanSet(planSetIndex) + 1) + planIndex); }
112
114 //-------------------------------------------------------------
116 //-------------------------------------------------------------
118protected:
119 GX_CHAR* _pBuffer;
121
123};
124
125#if GX_DEVELOP
126//===========================================================================
128//===========================================================================
129class GxResActionPlanningXml : public GxResActionPlanning
130{
131 //-----------------------------------------------------------
133 //-----------------------------------------------------------
135public:
136 // RTTI宣言
137 GX_RTTI_RESOURCE(GxResActionPlanningXml, GxResActionPlanning)
138 // GxClassBaseReference継承クラス用禁止宣言
139 GX_PROHIBIT_CLASS_BASE_REFERENCE(GxResActionPlanningXml)
140
141
142 class GxEditPlanSet : public GxClassBase
143 {
144 //-----------------------------------------------------------
146 //-----------------------------------------------------------
148 public:
149 // RTTI宣言
150 GX_RTTI_CLASS(GxResActionPlanningXml::GxEditPlanSet, GxClassBase)
151 // GxClassBase継承クラス用禁止宣言
152 GX_PROHIBIT_CLASS_BASE(GxEditPlanSet)
154 class GxEditPlan : public GxClassBase
155 {
156 //-------------------------------------------------------------
158 //-------------------------------------------------------------
160 public:
161 // RTTI宣言
162 GX_RTTI_CLASS(GxResActionPlanningXml::GxEditPlanSet::GxEditPlan, GxClassBase)
163
164
165 //-------------------------------------------------------------
167 //-------------------------------------------------------------
169
171 GxEditPlan(void);
173 ~GxEditPlan(void) override;
174
176 //-------------------------------------------------------------
178 //-------------------------------------------------------------
180
182 void getData(GxPlanParam* pData) const;
184 void setData(GxPlanParam* pData);
186 static GxGuiBase* createGui(GxProperty& property, GxTypedObject* pOwner, const GxRtti& rtti, u32 index = 0);
187
189 //-------------------------------------------------------------
191 //-------------------------------------------------------------
193 public:
194 GX_ENUM* _pActionTable;
195 u32 _tableSize;
196 u32 _action;
197 f32 _time;
198 b32 _initializeFlag;
199 b32 _attributeFlag[NUM_ATTRIBUTE];
200 GX_ENUM* _pTable;
201
203 };
204
206 //-------------------------------------------------------------
208 //-------------------------------------------------------------
210
212 GxEditPlanSet(void);
214 ~GxEditPlanSet(void) override;
215
217 //-------------------------------------------------------------
219 //-------------------------------------------------------------
221
223 void getData(GxPlanSetParam* pData) const;
225 void setData(GxPlanSetParam* pData);
226
228 void initialize(void);
230 GX_FORCE_INLINE GxEditPlan* getPlan(u32 index){ return &_plan[index]; }
232 static GxGuiBase* createGui(GxProperty& property, GxTypedObject* pOwner, const GxRtti& rtti, u32 index = 0);
233
235 //-------------------------------------------------------------
237 //-------------------------------------------------------------
239 public:
240 s32 _id;
241 GxString _comment;
242 private:
243 GxEditPlan _plan[PLAN_MAX];
244
246 };
247
249 //-------------------------------------------------------------
251 //-------------------------------------------------------------
253
255 GxResActionPlanningXml(void) : _editRttiId(GxRtti::DEFAULT_ID){}
256
258 //-------------------------------------------------------------
260 //-------------------------------------------------------------
262protected:
264 GX_FORCE_INLINE b32 load(GxStream& stream, u32 /*dataSize*/){ return GxResBase::loadXml(stream); }
266 GX_FORCE_INLINE b32 save(GxStream& stream){ return GxResBase::saveXml(stream, GxResActionPlanningXml::GX_RTTI); }
268 b32 finalize(void);
269
271 //-----------------------------------------------------------
273 //-----------------------------------------------------------
275public:
277 GX_FORCE_INLINE GxEditPlanSet* getPlanSet(u32 index){ return &_planSet[index]; }
279 constexpr u32 getEditRttiId(void) const { return _editRttiId; }
281 void setActionTable(GX_ENUM* pTable, u32 size);
282
284 //-------------------------------------------------------------
286 //-------------------------------------------------------------
288private:
289 u32 _editRttiId;
290 GxEditPlanSet _planSet[PLAN_SET_MAX];
291
293};
294
295#endif // GX_DEVELOP
296
297GX_CHARACTER_NAMESPACE_END()
#define GX_PROHIBIT_CLASS_BASE_REFERENCE(__CLASS__)
GxClassBaseReference継承の禁止宣言(new以外の生成禁止 + コピー禁止)
Definition GxBase.h:244
#define GX_PROHIBIT_CLASS_BASE(__CLASS__)
GxClassBase継承の禁止宣言
Definition GxBase.h:240
void GxTypedObject
その他
Definition GxDefine.h:213
#define GX_RTTI_RESOURCE(__THIS__, __BASE__)
リソースクラス型情報宣言
Definition GxRttiResource.h:102
配列クラス
Definition GxArray.h:18
オブジェクト基底クラス
Definition GxBase.h:88
プロパティクラス
Definition GxProperty.h:48
予約行動セットリソースクラス
Definition GxResActionPlanning.h:18
GX_FORCE_INLINE u32 getPlanSetNum(void) const
予約行動セットの個数を取得
Definition GxResActionPlanning.h:101
u32 _bufferSize
データサイズ
Definition GxResActionPlanning.h:120
GX_CHAR * _pBuffer
finalizeデータ
Definition GxResActionPlanning.h:119
GX_FORCE_INLINE GxHeader * getHeader(void) const
ヘッダ情報の取得
Definition GxResActionPlanning.h:97
GX_FORCE_INLINE GxPlanParam * getPlan(u32 planSetIndex, u32 planIndex) const
予約行動を取得する
Definition GxResActionPlanning.h:105
b32 load(GxStream &stream, u32 dataSize)
リソースのロード
Definition GxResActionPlanning.cpp:45
GX_FORCE_INLINE GxPlanSetParam * getPlanSet(u32 planSetIndex) const
予約行動セットを取得する
Definition GxResActionPlanning.h:103
static constexpr u32 PLAN_SET_MAX
1ファイルあたりのパターン数
Definition GxResActionPlanning.h:34
リソース基底クラス
Definition GxResBase.h:23
実行時型情報クラス
Definition GxRtti.h:154
ストリーム基礎クラス
Definition GxStream.h:20
static constexpr u32 ACTION_NUMBER_MAX
アクション番号の最大数
Definition GxUnitCharacterBase.h:38
GUI用
Definition GxDefine.h:194
ヘッダ
Definition GxResActionPlanning.h:42
u32 _unitRttiId
どのユニット用のデータか
Definition GxResActionPlanning.h:43
u32 _numPlanSet
予約行動セットの数
Definition GxResActionPlanning.h:44
予約行動パラメータ
Definition GxResActionPlanning.h:54
b32 _initializeFlag
初期化フラグ
Definition GxResActionPlanning.h:57
u32 _attribute
アトリビュート
Definition GxResActionPlanning.h:58
f32 _time
終了時間
Definition GxResActionPlanning.h:56
予約行動セットパラメータ
Definition GxResActionPlanning.h:48
s32 _id
セットID
Definition GxResActionPlanning.h:49
u32 _numPlan
予約行動の数
Definition GxResActionPlanning.h:50
文字列型クラス
Definition GxString.h:18
32bitブーリアン
Definition GxDefine.h:173