OROCHI
 
Loading...
Searching...
No Matches
GxResBackgroundCollisionSet.h
Go to the documentation of this file.
1//===========================================================================
9//===========================================================================
10#pragma once
11
14
15//===========================================================================
17//===========================================================================
19{
20 //-----------------------------------------------------------
22 //-----------------------------------------------------------
24public:
25 // RTTI定義
26 GX_RTTI_RESOURCE_NAME(GxResBackgroundCollisionSet, GxResBase, "ヒットフラグ設定リソース");
27 // GxClassBaseReference継承クラス用禁止宣言
29
31
33 static constexpr s32 FILTER_NOT_FOUND = -1;
34
35private:
37 static constexpr s32 NO_SETTING_FOUND = -1;
38
40 //-----------------------------------------------------------
42 //-----------------------------------------------------------
44public:
47
49 void cleanup(void) override;
50
52 //-----------------------------------------------------------
54 //-----------------------------------------------------------
56public:
58 b32 load(GxStream& stream, u32 /*dataSize*/);
59#if GX_DEVELOP
61 b32 save(GxStream& stream);
62#endif //GX_DEVELOP
63
65 GxBackgroundCollisionSetData* createBackgroundCollisionSetData(u32 materialNumber, u32 presetNumber, u32 hitFlag, GX_CSTR materialName, b32 isAcceptSameSetting = false, u32 allocCount = 1);
66
68 void updateBackgroundCollisionSetData(u32 index, u32 materialNumber, u32 presetNumber, GX_CSTR materialName, GX_CSTR presetName, u32 hitFlag) const;
69
71 void deleteBackgroundCollisionSetData(u32 index);
72
73private:
75 s32 getBackgroundCollisionSetDataIndex(u32 materialNumber) const;
76
78 s32 getBackgroundCollisionSetDataIndex(GxString materialName) const;
79
81 //-----------------------------------------------------------
83 //-----------------------------------------------------------
85public:
87 GxBackgroundCollisionSetData* getBackgroundCollisionSetData(u32 materialNumber);
88
90 GxBackgroundCollisionSetData* getBackgroundCollisionSetData(GxString materialName);
91
93 GxBackgroundCollisionSetData const* getBackgroundCollisionSetData(u32 materialNumber, u32 presetNumber) const;
94
96 constexpr GxBackgroundCollisionSetData* getBackgroundCollisionSetDataArrayIndex(u32 index) const { return static_cast<GxBackgroundCollisionSetData*>(_pSettingsArray[index]); }
97
99 constexpr u32 getBackgroundCollisionSetDataCount(void){ return _settingsCount; }
100
102 constexpr GxResHitFlagPreset* getResHitFlagPreset(void) const { return _pResHitFlagPreset; }
104 constexpr void setResHitFlagPreset(GxResHitFlagPreset* pResHitFlagPreset) { _pResHitFlagPreset = pResHitFlagPreset; }
105
106private:
108 void getPropertyBackgroundCollisionSetData(void* pValue, u32 index);
109
111 void setPropertyBackgroundCollisionSetData(const void* pValue, u32 index);
112
114 u32 getPropertySettingsCount(void);
115
117 void setPropertySettingsCount(u32 settingsCount);
118
120 //-----------------------------------------------------------
122 //-----------------------------------------------------------
124protected:
128
130};
131
132//===========================================================================
134//===========================================================================
136{
137 //-----------------------------------------------------------
139 //-----------------------------------------------------------
141public:
142 // RTTI定義
144 // NEW,DELETEのオーバーライド
145 GX_OPERATOR_NEW_DELETE_USE_ARRAY(GxAllocatorList::ALLOCATOR_TYPE::RESOURCE);
146 // GxClassBaseReference継承クラス用禁止宣言
148
150 //-----------------------------------------------------------
152 //-----------------------------------------------------------
154public:
158 GxBackgroundCollisionSetData(u32 materialNumber, u32 presetNumber, u32 hitFlag, GX_CSTR materialName);
160 ~GxBackgroundCollisionSetData(void) override;
161
163 //-----------------------------------------------------------
165 //-----------------------------------------------------------
167#if GX_DEVELOP
169 static GxGuiBase* createGui(GxProperty& property, GxTypedObject* pOwner, const GxRtti& rtti, u32 index = 0);
170#endif
171
173 //-----------------------------------------------------------
175 //-----------------------------------------------------------
177public:
179 constexpr u32 getMaterialNumber(void) const { return _materialNumber; }
180
182 constexpr void setMaterialNumber(u32 materialNumber){ _materialNumber = materialNumber; }
183
185 constexpr u32 getPresetNumber(void) const { return _presetNumber; }
186
188 constexpr void setPresetNumber(s32 presetNumber){ _presetNumber = presetNumber; }
189
191 GX_FORCE_INLINE GxString* getMaterialName(void){ return &_materialName; }
192
194 GX_FORCE_INLINE void setMaterialName (GX_CSTR materialName){ _materialName = materialName; }
195
197 GX_FORCE_INLINE void setMaterialName (const GxString& materialName){ _materialName = materialName; }
198
200 GX_FORCE_INLINE GxString* getPresetName(void){ return &_presetName; }
201
203 GX_FORCE_INLINE void setPresetName(GX_CSTR presetName){ _presetName = presetName; }
204
206 constexpr u32 getHitFlag(void) const { return _hitFlag; }
207
209 constexpr void setHitFlag(u32 hitflag){ _hitFlag = hitflag; }
210
212 constexpr void setPresetNameList(GX_ENUM* pPresetNameList, s32 size){ _pPresetNameList = pPresetNameList; _presetNameSize = size;}
213
215 constexpr s32 getAttributeNumber(void) const { return _attributeNumber; }
216
218 constexpr void setAttributeList(GX_ENUM* pAttributeList, s32 size){ _pAttributeList = pAttributeList; _attributeSize = size; }
219
221 //-----------------------------------------------------------
223 //-----------------------------------------------------------
225private:
226 u32 _materialNumber;
227 s32 _presetNumber;
228 GxString _materialName;
229 GxString _presetName;
230 u32 _hitFlag;
231 s32 _attributeNumber;
232
233 static GX_ENUM* _pPresetNameList;
234 static s32 _presetNameSize;
235
236 static GX_ENUM* _pAttributeList;
237 static s32 _attributeSize;
238
240};
241
242#if GX_DEVELOP
243//===========================================================================
245//===========================================================================
246class GxResBackgroundCollisionSetXml : public GxResBackgroundCollisionSet
247{
248 //-----------------------------------------------------------
250 //-----------------------------------------------------------
252public:
253 // RTTI定義
254 GX_RTTI_RESOURCE_NAME(GxResBackgroundCollisionSetXml, GxResBackgroundCollisionSet, "ヒットフラグ設定XMLリソース");
255 GX_OPERATOR_NEW_DELETE_USE_ARRAY(GxAllocatorList::ALLOCATOR_TYPE::DEVELOP);
256 // GxClassBaseReference継承クラス用禁止宣言
257 GX_PROHIBIT_CLASS_BASE_REFERENCE(GxResBackgroundCollisionSetXml);
258
260 //-----------------------------------------------------------
262 //-----------------------------------------------------------
264public:
266 GxResBackgroundCollisionSetXml(void);
268 void initialize(u32 motionCount);
269
271 //-----------------------------------------------------------
273 //-----------------------------------------------------------
275public:
277 void updateMaterialNameList(GX_ENUM* pList, s32 size);
278
280 void updatePresetNameList(GX_ENUM* pList, s32 size);
281
283 void updateAttributeList(GX_ENUM* pList, s32 size);
284
285protected:
287 b32 load(GxStream& in, u32 /*dataSize*/);
288
290 b32 save(GxStream& out);
291
293};
294
295#endif // GX_DEVELOP
296
297GX_PHYSICS_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_PHYSICS_NAMESPACE_BEGIN()
ネームスペースマクロ
Definition GxPhysics.h:28
配列クラス
Definition GxArray.h:18
オブジェクト基底クラス
Definition GxBase.h:88
プロパティクラス
Definition GxProperty.h:48
ヒットフラグ設定データクラス
Definition GxResBackgroundCollisionSet.h:136
GX_FORCE_INLINE GxString * getPresetName(void)
プリセット名を取得
Definition GxResBackgroundCollisionSet.h:200
constexpr void setPresetNameList(GX_ENUM *pPresetNameList, s32 size)
プリセットネームリストを設定
Definition GxResBackgroundCollisionSet.h:212
constexpr void setMaterialNumber(u32 materialNumber)
マテリアル番号を設定
Definition GxResBackgroundCollisionSet.h:182
GX_FORCE_INLINE void setPresetName(GX_CSTR presetName)
プリセット名を設定
Definition GxResBackgroundCollisionSet.h:203
GX_FORCE_INLINE void setMaterialName(GX_CSTR materialName)
マテリアル名を設定(GX_CSTR)
Definition GxResBackgroundCollisionSet.h:194
GX_FORCE_INLINE void setMaterialName(const GxString &materialName)
マテリアル名を設定(GxString)
Definition GxResBackgroundCollisionSet.h:197
constexpr u32 getPresetNumber(void) const
プリセット番号を取得
Definition GxResBackgroundCollisionSet.h:185
constexpr u32 getHitFlag(void) const
ヒットフラグ値を取得
Definition GxResBackgroundCollisionSet.h:206
constexpr s32 getAttributeNumber(void) const
属性リストの取得
Definition GxResBackgroundCollisionSet.h:215
GX_FORCE_INLINE GxString * getMaterialName(void)
マテリアル名を取得
Definition GxResBackgroundCollisionSet.h:191
constexpr void setPresetNumber(s32 presetNumber)
プリセット番号を設定
Definition GxResBackgroundCollisionSet.h:188
constexpr void setAttributeList(GX_ENUM *pAttributeList, s32 size)
属性リストを設定
Definition GxResBackgroundCollisionSet.h:218
constexpr u32 getMaterialNumber(void) const
マテリアル番号を取得
Definition GxResBackgroundCollisionSet.h:179
GxBackgroundCollisionSetData(void)
コンストラクタ
Definition GxResBackgroundCollisionSet.cpp:313
constexpr void setHitFlag(u32 hitflag)
ヒットフラグ値を設定
Definition GxResBackgroundCollisionSet.h:209
~GxBackgroundCollisionSetData(void) override
デストラクタ
Definition GxResBackgroundCollisionSet.cpp:343
ヒットフラグ設定リソースクラス
Definition GxResBackgroundCollisionSet.h:19
b32 load(GxStream &stream, u32)
Definition GxResBackgroundCollisionSet.cpp:91
constexpr GxResHitFlagPreset * getResHitFlagPreset(void) const
ヒットフラグプリセットリソースを取得
Definition GxResBackgroundCollisionSet.h:102
GxResHitFlagPreset * _pResHitFlagPreset
ヒットフラグプリセットリソース
Definition GxResBackgroundCollisionSet.h:127
constexpr GxBackgroundCollisionSetData * getBackgroundCollisionSetDataArrayIndex(u32 index) const
ヒットフラグ設定オブジェクトを取得
Definition GxResBackgroundCollisionSet.h:96
constexpr u32 getBackgroundCollisionSetDataCount(void)
ヒットフラグ設定オブジェクト数を取得
Definition GxResBackgroundCollisionSet.h:99
constexpr void setResHitFlagPreset(GxResHitFlagPreset *pResHitFlagPreset)
ヒットフラグプリセットリソースを設定
Definition GxResBackgroundCollisionSet.h:104
GxArray _pSettingsArray
ヒットフラグ設定データ配列
Definition GxResBackgroundCollisionSet.h:126
u32 _settingsCount
ヒットフラグ設定のサイズ
Definition GxResBackgroundCollisionSet.h:125
リソース基底クラス
Definition GxResBase.h:23
ヒットフラグのプリセットリソースクラス
Definition GxResHitFlagPreset.h:18
実行時型情報クラス
Definition GxRtti.h:154
ストリーム基礎クラス
Definition GxStream.h:20
GUI用
Definition GxDefine.h:194
文字列型クラス
Definition GxString.h:18
32bitブーリアン
Definition GxDefine.h:173