Vegastrike 0.5.1 rc1
1.0
Original sources for Vegastrike Evolved
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
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
{
9
float
frontlefttop
,
backlefttop
,
frontrighttop
,
backrighttop
,
frontleftbottom
,
backleftbottom
,
frontrightbottom
,
10
backrightbottom
;
11
12
Armor
()
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
23
struct
ShieldFacing
24
{
25
ShieldFacing
()
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];
59
float
frontmax
,
backmax
,
rightmax
,
leftmax
;
60
}
61
shield4fbrl
;
63
struct
64
{
65
float
frontrighttop
,
backrighttop
,
frontlefttop
,
backlefttop
,
frontrightbottom
,
backrightbottom
,
frontleftbottom
,
66
backleftbottom
;
67
float
frontrighttopmax
,
backrighttopmax
,
frontlefttopmax
,
backlefttopmax
,
frontrightbottommax
,
backrightbottommax
,
68
frontleftbottommax
,
backleftbottommax
;
69
}
70
shield8
;
71
struct
72
{
73
float
cur
[
MAX_SHIELD_NUMBER
];
74
float
max
[
MAX_SHIELD_NUMBER
];
75
}
76
shield
;
77
};
78
ShieldFacing
range
[
MAX_SHIELD_NUMBER
];
80
signed
char
number
;
82
char
leak
;
83
84
Shield
()
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
src
cmd
unit_armorshield.h
Generated on Fri May 29 2015 23:07:17 for Vegastrike 0.5.1 rc1 by
1.8.4