Merge branch 'fixes' into main/rendor-staging
[ryzomcore.git] / ryzom / common / src / game_share / action_dummy.h
blobd6effcbc6cbc3c1ef841b9d42b5125cb5ce71451
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.
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 NL_ACTION_DUMMY_H
20 #define NL_ACTION_DUMMY_H
22 #include "nel/misc/types_nl.h"
23 #include "action.h"
27 namespace CLFECOMMON {
29 /**
30 * Dummy action for test purpose
31 * \author Olivier Cado
32 * \author Nevrax France
33 * \date 2001
35 class CActionDummy : public CAction
37 public:
39 /** This function creates initializes its fields using the buffer.
40 * \param buffer pointer to the buffer where the data are
41 * \size size of the buffer
43 virtual void unpack (NLMISC::CBitMemStream &message) { message.serial( Dummy1 ); message.serial( Dummy2 ); }
45 /// This functions is used when you want to transform an action into an IStream.
46 virtual void serial (NLMISC::IStream &f) { f.serial( Dummy1 ); f.serial( Dummy2 ); }
48 /** Returns the size of this action when it will be send to the UDP connection:
49 * the size is IN BITS, not in bytes (the actual size is this one plus the header size)
51 virtual uint32 size () { return sizeof(Dummy1)*8 + sizeof(Dummy2)*8; }
53 static CAction *create () { return new CActionDummy(); }
55 uint32 Dummy1;
56 uint32 Dummy2;
58 protected:
60 /** This function transform the internal field and transform them into a buffer for the UDP connection.
61 * \param buffer pointer to the buffer where the data will be written
62 * \size size of the buffer
64 virtual void pack (NLMISC::CBitMemStream &message) { message.serial( Dummy1 ); message.serial( Dummy2 ); }
66 friend class CActionFactory;
71 #endif // NL_ACTION_DUMMY_H
73 /* End of action_dummy.h */