Linux multi-monitor fullscreen support
[ryzomcore.git] / ryzom / common / src / game_share / sphrase_com.h
bloba71a0824bdea32c3d7aed3d04184d645a627f735
1 // Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
2 // Copyright (C) 2010 Winch Gate Property Limited
3 //
4 // This source file has been modified by the following contributors:
5 // Copyright (C) 2020 Jan BOON (Kaetemi) <jan.boon@kaetemi.be>
6 //
7 // This program is free software: you can redistribute it and/or modify
8 // it under the terms of the GNU Affero General Public License as
9 // published by the Free Software Foundation, either version 3 of the
10 // License, or (at your option) any later version.
12 // This program is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 // GNU Affero General Public License for more details.
17 // You should have received a copy of the GNU Affero General Public License
18 // along with this program. If not, see <http://www.gnu.org/licenses/>.
22 #ifndef RY_SPHRASE_H
23 #define RY_SPHRASE_H
25 #include "nel/misc/types_nl.h"
26 #include "nel/misc/sheet_id.h"
27 #include "nel/misc/stream.h"
28 #include "persistent_data.h"
29 #include "persistent_data.h"
30 #include "inventories.h"
33 // ***************************************************************************
34 /**
35 * Description of a Sabrina Phrase. (ie set of brick, and other client side infos)
36 * For communication Client/Server (NB: CSPhrase name already exist...)
37 * \author Lionel Berenguier
38 * \author Nevrax France
39 * \date 2003
41 class CSPhraseCom
43 public:
44 static const CSPhraseCom EmptyPhrase;
46 public:
47 // Start by declaring methods for persistent load/ save operations
48 // The following macro is defined in persistent_data.h
49 // At time of writing it evaluated to:
50 // void store(CPersistentDataRecord &pdr) const;
51 // void apply(CPersistentDataRecord &pdr);
53 DECLARE_PERSISTENCE_METHODS
55 /// Constructor
56 CSPhraseCom(){}
58 // clear out the contents before filling with new data...
59 void clear()
61 Bricks.clear();
62 Name.clear();
65 // List Of SBricks composing the phrase.
66 std::vector<NLMISC::CSheetId> Bricks;
68 // Name Of the Phrase. Saved on server, read on client.
69 ucstring Name; // FIXME: UTF-8 (serial)
71 /// The comparison is made only on Bricks
72 bool operator==(const CSPhraseCom &p) const;
73 bool operator!=(const CSPhraseCom &p) const {return !operator==(p);}
74 bool operator<(const CSPhraseCom &p) const;
76 /// consider empty if Bricks.empty() or if brick 0 is 0.
77 bool empty() const {return Bricks.empty() || Bricks[0].asInt()==0;}
79 /// This serial is made for server->client com. NB: SheetId must be init.
80 void serial(NLMISC::IStream &impulse);
84 // ***************************************************************************
85 /**
86 * Tuple Sabrina / Known Slot.
87 * \author Lionel Berenguier
88 * \author Nevrax France
89 * \date 2003
91 class CSPhraseSlot
93 public:
94 CSPhraseCom Phrase;
95 uint16 KnownSlot;
96 NLMISC::CSheetId PhraseSheetId;
98 /// This serial is made for server->client com.
99 void serial(NLMISC::IStream &impulse);
103 // ***************************************************************************
104 class CSPhraseMemorySlot
106 public:
107 uint8 MemoryLineId;
108 uint8 MemorySlotId;
109 uint16 PhraseId;
111 /// This serial is made for server->client com.
112 void serial(NLMISC::IStream &impulse);
115 // ***************************************************************************
116 class CFaberMsgItem
118 uint8 InvId; // matchs INVENTORIES::EInventory
119 public:
120 uint16 IndexInInv; // index in the inventory
121 uint16 Quantity; // quantity of mp selected
123 void setInvId(INVENTORIES::TInventory invId)
125 InvId = invId;
127 INVENTORIES::TInventory getInvId()
129 return INVENTORIES::TInventory(InvId);
131 /// This serial is made for server->client com.
132 void serial(NLMISC::IStream &impulse);
135 #endif // NL_SPHRASE_H
137 /* End of sphrase_com.h */