mirrors.h

TcR1oo565, 09/23/2010 11:15 pm

Download (3.9 kB)

 
1
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
2
// Copyright (C) 2010  Winch Gate Property Limited
3
//
4
// This program is free software: you can redistribute it and/or modify
5
// it under the terms of the GNU Affero General Public License as
6
// published by the Free Software Foundation, either version 3 of the
7
// License, or (at your option) any later version.
8
//
9
// This program is distributed in the hope that it will be useful,
10
// but WITHOUT ANY WARRANTY; without even the implied warranty of
11
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
// GNU Affero General Public License for more details.
13
//
14
// You should have received a copy of the GNU Affero General Public License
15
// along with this program.  If not, see <http://www.gnu.org/licenses/>.
16

17

18

19
#ifndef RY_CMS_MIRRORS_H
20
#define RY_CMS_MIRRORS_H
21

22
// include files
23
#include "nel/misc/types_nl.h"
24
#include "nel/misc/entity_id.h"
25
#include "nel/misc/sheet_id.h"
26
#include "game_share/mode_and_behaviour.h"
27
#include "game_share/mirror.h"
28
#include "game_share/mirror_prop_value.h"
29
#include "game_share/ryzom_mirror_properties.h"
30
#include "game_share/player_visual_properties.h"
31

32

33
class CMirrors
34
{
35
public:
36
        // singleton initialisation and release
37
        static void                init( void (*cbUpdate)(), void (*cbSync)() = NULL, void (*cbRelease)() = NULL );
38
        static void                initMirror();
39
        static void                update() {}
40
        static void                processMirrorUpdates();
41
        static void                release();
42

43
        static bool                                        mirrorIsReady();
44

45
        static TDataSetRow                        createEntity( NLMISC::CEntityId& entityId );
46
        static void                                        declareEntity( const TDataSetRow& entityIndex );
47
        static void                                        removeEntity( const NLMISC::CEntityId& entityId );
48

49
        // TODO: check if good
50
        static bool                                        exists( const TDataSetRow& entityIndex );
51
        static const NLMISC::CEntityId&        getEntityId( const TDataSetRow& entityIndex );
52
        static TDataSetRow                        getDataSetRow( const NLMISC::CEntityId& entityId );
53
        static uint16                                getTeamId(const TDataSetRow& entityIndex);
54

55
        static CAICoord                                x( const TDataSetRow& entityIndex );
56
        static CAICoord                                y( const TDataSetRow& entityIndex );
57
        static sint32                                z( const TDataSetRow& entityIndex );
58
        static float                                theta( const TDataSetRow& entityIndex );
59
        static NLMISC::CSheetId                sheet( const TDataSetRow& entityIndex );
60
        static NLMISC::CSheetId                sheetServer( const TDataSetRow& entityIndex );
61
        static TDataSetRow                        target( const TDataSetRow& entityIndex );
62

63
        static void                                        initSheet( const TDataSetRow& entityIndex, const NLMISC::CSheetId& sheetId );
64
        static void                                        initSheetServer( const TDataSetRow& entityIndex, const NLMISC::CSheetId& sheetId );
65
        static void                                        initNPCAlias( const TDataSetRow& entityIndex, TAIAlias alias );
66
        static void                                        setPosAndTheta( const TDataSetRow& entityIndex, sint32 posX, sint32 posY, sint32 posZ, float angleRad );
67
        static void                                        setTheta( const TDataSetRow& entityIndex, float angleRad );
68
        static void                                        setBehaviour( const TDataSetRow& entityIndex, MBEHAV::EBehaviour b );
69
        static void                                        setTarget( const TDataSetRow& entityIndex, const TDataSetRow& target);
70
        
71
        // primary visual properties A, B, C
72
        static void                                        setVisualPropertyA( const TDataSetRow& entityIndex, const SPropVisualA &prop );
73
        static void                                        setVisualPropertyB( const TDataSetRow& entityIndex, const SPropVisualB &prop );
74
        static void                                        setVisualPropertyC( const TDataSetRow& entityIndex, const SPropVisualC &prop );
75

76
        // alternate visual property A
77
        static void                                        setVPA( const TDataSetRow& entityIndex, const SAltLookProp &prop );
78

79
        static uint32                                bestRoleLevel( const TDataSetRow& entityIndex );
80

81
        static uint64                                whoSeesMe( const TDataSetRow& entityIndex );
82
        
83
private:
84
        // this is a singleton so prohibit instance construction
85
        CMirrors();
86

87
public:
88
        static CMirror                        Mirror;
89
        static CMirroredDataSet        *DataSet;
90
        static CMirroredDataSet        *FameDataSet;
91
};
92

93

94
#define TheDataset (*CMirrors::DataSet)
95

96

97
#endif // RY_CMS_MIRRORS_H