Vegastrike 0.5.1 rc1  1.0
Original sources for Vegastrike Evolved
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
unit_armorshield.h
Go to the documentation of this file.
1 #ifndef __UNIT_ARMOR_SHIELD_H
2 #define __UNIT_ARMOR_SHIELD_H
3 
4 #include <algorithm>
5 
7 struct Armor
8 {
11 
13  : frontlefttop( 0 )
14  , backlefttop( 0 )
15  , frontrighttop( 0 )
16  , backrighttop( 0 )
17  , frontleftbottom( 0 )
18  , backleftbottom( 0 )
19  , frontrightbottom( 0 )
20  , backrightbottom( 0 ) {}
21 };
22 #define MAX_SHIELD_NUMBER 8
24 {
26  : thetamin(0.0)
27  , thetamax(0.0)
28  , rhomin(0.0)
29  , rhomax(0.0)
30  {}
31 
32  float thetamin;
33  float thetamax;
34  float rhomin;
35  float rhomax;
36 };
38 struct Shield
39 {
41  float recharge;
42  float efficiency;
43  //A union containing the different shield values and max values depending on number
44  union
45  {
47  struct
48  {
49  float front, back;
50  float padding[6];
51  float frontmax, backmax;
52  }
53  shield2fb;
55  struct
56  {
57  float front, back, right, left;
58  float padding[4];
60  }
63  struct
64  {
69  }
70  shield8;
71  struct
72  {
75  }
76  shield;
77  };
80  signed char number;
82  char leak;
83 
85  : recharge(0)
86  , efficiency(0)
87  , number(0)
88  , leak(0)
89  {
90  std::fill_n(shield.cur, sizeof(shield.cur)/sizeof(shield.cur[0]), 0.0f);
91  std::fill_n(shield.max, sizeof(shield.max)/sizeof(shield.max[0]), 0.0f);
92  std::fill_n(range, sizeof(range)/sizeof(range[0]), ShieldFacing());
93  }
94 };
95 
96 #endif
97