SEGS  0.4.2
Super Entity Game Server
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Powers.h
Go to the documentation of this file.
1 /*
2  * SEGS - Super Entity Game Server
3  * http://www.segs.io/
4  * Copyright (c) 2006 - 2018 SEGS Team (see Authors.txt)
5  * This software is licensed! (See License.txt for details)
6  */
7 
8 #pragma once
9 #include "CommonNetStructures.h"
10 #include <QtCore/QString>
11 #include "BitStream.h"
12 
13 enum class TrayItemType : uint32_t
14 {
15  None = 0,
16  Power = 1,
17  Inspiration = 2,
18  BodyItem = 3,
21  Macro = 6,
22  Count = 7,
23 };
24 
26 {
27 public:
30  int power_idx;
31  void serializefrom( BitStream &src );
32  void serializeto( BitStream &src ) const;
33 };
34 
35 class Power
36 {
37 public:
40  QString command;
41  QString short_name;
42  QString icon_name;
43  void serializeto(BitStream &tgt) const;
44  void serializefrom(BitStream &src);
45 
46  void Dump();
47 };
48 
49 class PowerTray
50 {
51 public:
53  Power *getPower(size_t idx);
54  int setPowers();
55  void serializefrom(BitStream &src);
56  void serializeto(BitStream &tgt) const;
57  void Dump();
58 };
59 
61 {
62  static const int num_trays=2; // was 3, displayed trays
63  PowerTray m_trays[9];
64  uint32_t m_default_powerset_idx,m_default_power_idx;
65  bool m_c;
66  int primary_tray_idx=0;
67  int secondary_tray_idx=1;
68 public:
70  {
71  m_default_powerset_idx=m_default_power_idx=0;
72  m_c=false;
73  }
74  void serializeto(BitStream &tgt) const;
75  void serializefrom(BitStream &src);
76  void dump();
77 
78 };
void serializeto(BitStream &tgt) const
Definition: Powers.cpp:85
Power m_powers[10]
Definition: Powers.h:52
void Dump()
Definition: Powers.cpp:66
Definition: Powers.h:25
int power_idx
Definition: Powers.h:30
void serializeto(BitStream &src) const
Definition: Powers.cpp:182
Definition: Powers.h:35
Definition: BitStream.h:30
int power_idx
Definition: Powers.h:39
TrayItemType entry_type
Definition: Powers.h:38
Definition: Powers.h:49
void serializeto(BitStream &tgt) const
Definition: Powers.cpp:16
int powerset_idx
Definition: Powers.h:39
void serializefrom(BitStream &src)
Definition: Powers.cpp:41
int powerset_entry_idx
Definition: Powers.h:29
int setPowers()
Definition: Powers.cpp:144
void serializefrom(BitStream &src)
Definition: Powers.cpp:100
QString icon_name
Definition: Powers.h:42
Definition: Powers.h:60
PowerTrayGroup()
Definition: Powers.h:69
TrayItemType
Definition: Powers.h:13
void serializefrom(BitStream &src)
Definition: Powers.cpp:154
QString short_name
Definition: Powers.h:41
void serializeto(BitStream &tgt) const
Definition: Powers.cpp:160
void serializefrom(BitStream &src)
Definition: Powers.cpp:175
void Dump()
Definition: Powers.cpp:166
QString command
Definition: Powers.h:40
int category_idx
Definition: Powers.h:28
Power * getPower(size_t idx)
Definition: Powers.cpp:137
void dump()
Definition: Powers.cpp:116