Linux multi-monitor fullscreen support
[ryzomcore.git] / ryzom / client / src / client_sheets / attack_id_sheet.h
blob42b678a13a2c2264d03c0c5ed857451dc75737af
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/>.
17 #ifndef CL_ATTACK_ID_H
18 #define CL_ATTACK_ID_H
20 #include "game_share/magic_fx.h"
21 #include "game_share/range_weapon_type.h"
24 /** Identifier of an attack (magic, range, melle, or creature)
25 * This helps doing the links between attack behaviour and its graphical representation
28 * \author Nicolas Vizerie
29 * \author Nevrax France
30 * \date 2004
32 class CAttackIDSheet
34 public:
35 enum TType { Melee = 0, Range, Magic, Creature, DamageShield, Unknown };
37 class CSpellInfo
39 public:
40 MAGICFX::TSpellMode Mode;
41 MAGICFX::TMagicFx ID;
42 public:
43 void build(const NLGEORGES::UFormElm &item, const std::string &prefix);
44 void serial(NLMISC::IStream &f);
46 public:
47 TType Type;
48 union
50 CSpellInfo SpellInfo; // valid if type == Magic
51 RANGE_WEAPON_TYPE::TRangeWeaponType RangeWeaponType; // valid if type == Range
52 uint32 CreatureAttackIndex; // valid if type == Creature. Currently, maybe 0 or 1 2 attack per creature)
53 uint32 DamageShieldType; // valid if type == DamageShield
55 public:
56 virtual void build(const NLGEORGES::UFormElm &item, const std::string &prefix);
57 virtual void serial(NLMISC::IStream &f);
60 // compares spell infos
61 bool operator == (const CAttackIDSheet::CSpellInfo &lhs, const CAttackIDSheet::CSpellInfo &rhs);
62 inline bool operator != (const CAttackIDSheet::CSpellInfo &lhs, const CAttackIDSheet::CSpellInfo &rhs) { return !(lhs == rhs); }
63 // build an ordering between attack ids
64 bool operator < (const CAttackIDSheet::CSpellInfo &lhs, const CAttackIDSheet::CSpellInfo &rhs);
65 // compares 2 attack ids
66 bool operator == (const CAttackIDSheet &lhs, const CAttackIDSheet &rhs);
67 inline bool operator != (const CAttackIDSheet &lhs, const CAttackIDSheet &rhs) { return !(lhs == rhs); }
68 // build an ordering between attack ids
69 bool operator < (const CAttackIDSheet &lhs, const CAttackIDSheet &rhs);
73 #endif