1 // Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
2 // Copyright (C) 2010 Winch Gate Property Limited
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.
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.
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/>.
19 #ifndef RY_ENTITY_STATE_H
20 #define RY_ENTITY_STATE_H
22 #include "nel/misc/vector_2d.h"
23 #include "nel/misc/vector.h"
25 #include "game_share/far_position.h"
26 #include "game_share/mirror_prop_value.h"
31 * \author Stephane Coutelas
32 * \author Nevrax France
38 // Start by declaring methods for persistent load/ save operations
39 // The following macro is defined in persistent_data.h
40 // At time of writing it evaluated to:
41 // void store(CPersistentDataRecord &pdr) const;
42 // void apply(CPersistentDataRecord &pdr);
44 DECLARE_PERSISTENCE_METHODS
46 CMirrorPropValueAlice
< sint32
, CPropLocationPacked
<2> > X
;
47 CMirrorPropValueAlice
< sint32
, CPropLocationPacked
<2> > Y
;
48 CMirrorPropValueAlice
< sint32
, CPropLocationPacked
<2> > Z
;
50 CMirrorPropValueAlice
< float, CPropLocationPacked
<2> > Heading
;
65 const CEntityState
&operator = (const COfflineEntityState
&s
)
77 void setCOfflineEntityState( COfflineEntityState
&s
) const
87 * Store temporaryly the state from an COfflineEntityState object (for later mirrorizing)
89 void storeToTemp( const COfflineEntityState
& state
)
94 Heading
= state
.Heading
;
98 * Serial (read to temp storage, or write from mirror)
100 void serial(NLMISC::IStream
&f
)
105 Heading
.serialRTWM( f
);
109 * Fill vector in meter corresponding to state
111 void getVector( NLMISC::CVector
& v
) const
119 * Fill a CVectorfD in meter corresponding to state
121 void getVector2f( NLMISC::CVector2f
& v
) const
129 inline COfflineEntityState::COfflineEntityState(const CEntityState
& state
)
134 Heading
= state
.Heading
;
138 #endif // RY_ENTITY_STATE_H