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
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;
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 };
50 {
52  int level;
53  float curtime;
54  float maxtime;
55  float obedience; //short fix
56  std::vector< std::list< AIEvresult > >result;
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