OROCHI
 
Loading...
Searching...
No Matches
GxResCurveKey.h
Go to the documentation of this file.
1//===========================================================================
9//===========================================================================
10#pragma once
11
12GX_CORE_NAMESPACE_BEGIN()
13class GxCurveKey;
14//===========================================================================
16//===========================================================================
18{
19 //-------------------------------------------------------------
21 //-------------------------------------------------------------
23public:
24 // RTTI定義
25 GX_RTTI_RESOURCE_NAME(GxResCurveKey, GxResBase, "カーブキーリソース")
26 // GxClassBaseReference継承クラス用禁止宣言
28
29
30 //-----------------------------------------------------------
32 //-----------------------------------------------------------
34public:
36 GxResCurveKey( void );
38 void cleanup( void ) override;
39
41 //-----------------------------------------------------------
43 //-----------------------------------------------------------
45protected:
47 b32 load( GxStream& in, u32 dataSize );
48#if GX_DEVELOP
50 b32 save( GxStream& out );
51#endif //GX_DEVELOP
52
53public:
54#if GX_EDITOR
56 void getToolRtti( GxArray& arrayTool ) const override;
57#endif // GX_DEVELOP
58
59#if GX_DEVELOP
61 void addKey( GxCurveKey* pKey );
63 b32 deleteKey( GxCurveKey* pKey );
65 b32 hasKey( GxCurveKey* pKey );
67 s32 getKeyIndex( GxCurveKey* pKey ) const;
69 GxCurveKey* getKey( u32 index ) const;
71 void sort( void );
72#endif // GX_DEVELOP
73
75 void releaseKeyList( void );
76
78 //-----------------------------------------------------------
80 //-----------------------------------------------------------
82public:
84 constexpr u32 getCount( void ) const { return _keyList.getCount(); }
86 f32 getValue( f32 time ) const;
88 f32 getMaxTime( void );
89
91 //-----------------------------------------------------------
93 //-----------------------------------------------------------
95protected:
96 GX_CHAR* _pBuffer;
98
100
102};
103
104#if GX_DEVELOP
105//===========================================================================
107//===========================================================================
108class GxResCurveKeyXml : public GxResCurveKey
109{
110 //-------------------------------------------------------------
112 //-------------------------------------------------------------
114public:
115 // RTTI定義
116 GX_RTTI_RESOURCE(GxResCurveKeyXml, GxResCurveKey)
117 // GxClassBaseReference継承クラス用禁止宣言
118 GX_PROHIBIT_CLASS_BASE_REFERENCE(GxResCurveKeyXml)
119
120
121 //-----------------------------------------------------------
123 //-----------------------------------------------------------
125public:
127 GxResCurveKeyXml( void ) {}
128
130 //-----------------------------------------------------------
132 //-----------------------------------------------------------
134protected:
136 b32 load( GxStream& in, u32 /*dataSize*/) { return GxResBase::loadXml(in); }
138 b32 save( GxStream& out ) { return GxResBase::saveXml(out, GxResCurveKeyXml::GX_RTTI); }
139
141};
142#endif // GX_DEVELOP
143
144GX_CORE_NAMESPACE_END()
#define GX_PROHIBIT_CLASS_BASE_REFERENCE(__CLASS__)
GxClassBaseReference継承の禁止宣言(new以外の生成禁止 + コピー禁止)
Definition GxBase.h:244
#define GX_RTTI_RESOURCE(__THIS__, __BASE__)
リソースクラス型情報宣言
Definition GxRttiResource.h:102
配列クラス
Definition GxArray.h:18
カーブキークラス
Definition GxModUnitCurvePlay.h:477
リソース基底クラス
Definition GxResBase.h:23
カーブキーリソース
Definition GxResCurveKey.h:18
GxArray _keyList
キーリスト
Definition GxResCurveKey.h:99
u32 _bufferSize
finalizeデータサイズ
Definition GxResCurveKey.h:97
GX_CHAR * _pBuffer
finalizeデータ
Definition GxResCurveKey.h:96
constexpr u32 getCount(void) const
キー数取得
Definition GxResCurveKey.h:84
b32 load(GxStream &in, u32 dataSize)
リソースのロード
Definition GxResCurveKey.cpp:51
ストリーム基礎クラス
Definition GxStream.h:20
32bitブーリアン
Definition GxDefine.h:173