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
event_xml.h
Go to the documentation of this file.
1
#ifndef _CMD_AI_EVENT_XML_H_
2
#define _CMD_AI_EVENT_XML_H_
3
#include "
xml_support.h
"
4
#include <string>
5
#include <vector>
6
#include <list>
15
namespace
AIEvents
16
{
18
struct
AIEvresult
19
{
21
int
type
;
23
float
max
,
min
;
24
float
timetofinish
;
25
float
timetointerrupt
;
26
float
priority
;
28
std::string
script
;
29
AIEvresult
(
int
type
,
30
float
const
min
,
31
const
float
max
,
32
float
timetofinish
,
33
float
timetointerrupt
,
34
float
priority
,
35
const
std::string &aiscript );
36
bool
Eval
(
const
float
eval )
const
37
{
38
if
(eval >=
min
)
39
if
(eval <
max
)
40
if
(
type
> 0)
41
return
true
;
42
if
(eval <
min
)
43
if
(eval >=
max
)
44
if
(
type
< 0)
45
return
true
;
46
return
false
;
47
}
48
};
49
struct
ElemAttrMap
50
{
51
XMLSupport::EnumMap
element_map
;
52
int
level
;
53
float
curtime
;
54
float
maxtime
;
55
float
obedience
;
//short fix
56
std::vector< std::list< AIEvresult > >
result
;
57
ElemAttrMap
(
const
XMLSupport::EnumMap
&el ) :
58
element_map
( el )
59
,
level
( 0 ) {}
60
};
61
void
LoadAI
(
const
char
*filename, ElemAttrMap &result,
const
std::string &
faction
);
//num seconds
62
}
63
#endif
64
src
cmd
ai
event_xml.h
Generated on Fri May 29 2015 23:07:07 for Vegastrike 0.5.1 rc1 by
1.8.4