summaryrefslogtreecommitdiffstats
path: root/tools/statepropbuilder/inc/stateprop/statepropdata.hpp
blob: b454f34b5413f179b90a4c104e27549043d2611c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
#ifndef _STATEPROPDATA_HPP_
#define _STATEPROPDATA_HPP_


#include <radmath/radmath.hpp>
#include <p3d/loadmanager.hpp>

#include "stateprop/statepropdatatypes.hpp"

//=============================================================================
// Forward Class/Struct Declarations
//=============================================================================

class CStateProp;
class tAnimatedObjectFactory;
class CStatePropDataLoader;

//=============================================================================
// Definitions
//=============================================================================

//State data
struct StateData
{
    TransitionData          transitionData;
	VisibilityData*         visibilityData;
    FrameControllerData*    frameControllerData;
	EventData*              eventData;
	CallbackData*           callbackData;	

	unsigned int            numEvents;
	unsigned int            numCallbacks;
};

//=============================================================================
// Class Declarations
// Prop
//=============================================================================

class CStatePropData : public tEntity
{

public:

	friend class CStatePropDataLoader;

	CStatePropData();
    ~CStatePropData();

    // State Data =====================================================================================
    unsigned int GetNumberOfStates();
    StateData GetStateData( unsigned int state );

	//Transition Data ==================================================================================
    TransitionData GetTransitionData( int state );

    //Visibility Data ==================================================================================
    VisibilityData GetVisibilityData( int state , int index);

    //Frame Controller Data =============================================================================
    FrameControllerData GetFrameControllerData( int state, int fc );

	//Event Data ========================================================================================
    unsigned int GetNumberOfEvents( int state );
    EventData GetEventData( int state , int eventindex );

	//Callback Data ======================================================================================
    unsigned int GetNumberOfCallbacks( int state );
    CallbackData GetCallbackData( int state , int eventindex );

    tAnimatedObjectFactory* GetAnimatedObjectFactory() { return m_ObjectFactory; }

private:

	//animated object factory
	char m_FactoryName[64];
	tAnimatedObjectFactory* m_ObjectFactory;
	
    //total number of states
	unsigned int m_NumStates;
    StateData** m_StateData;
};


//=============================================================================
// Class Declarations
// PropLoader
//=============================================================================
class CStatePropDataLoader : public tSimpleChunkHandler
{
public:
    CStatePropDataLoader();
    tEntity* LoadObject(tChunkFile* file, tEntityStore* store);

protected:
    ~CStatePropDataLoader() {};
};

#endif //_STATEPROPDATA_HPP_