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
missionscript.h
Go to the documentation of this file.
1 /*
2  * Vega Strike
3  * Copyright (C) 2001-2002 Daniel Horn
4  *
5  * http://vegastrike.sourceforge.net/
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 2
10  * of the License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20  */
21 
22 /*
23  * AI for mission scripting written by Alexander Rawass <alexannika@users.sourceforge.net>
24  */
25 
26 #ifndef _CMD_AI_MISSION_SCRIPT_H_
27 #define _CMD_AI_MISSION_SCRIPT_H_
28 
29 #include "order.h"
30 #include "navigation.h"
31 #include "flybywire.h"
32 
33 #include "cmd/script/mission.h"
34 
35 class AImissionScript : public FlyByWire
36 {
37 public:
39  AImissionScript( string modulename );
42  void Execute();
43 
44  virtual string getOrderDescription()
45  {
46  char buffer[300];
47  sprintf( buffer, "%s:%d:%s", modulename.c_str(), classid, getActionString().c_str() );
48  return buffer;
49  }
50 
51 protected:
52 
53  string modulename;
54  unsigned int classid;
55  bool first_run;
56 };
57 
59 {
60 public: AIFlyToWaypoint( const QVector &waypoint, float vel, bool afburn, float range );
61 
63  float vel;
64  float range;
65  bool aburn;
66 };
68 {
69 public: AIFlyToWaypointDefend( const QVector &waypoint, float vel, bool afburn, float range, float defend_range );
70 
72  float vel;
73  float range;
74  bool aburn;
75 };
76 
78 {
79 public: AIFlyToJumppoint( Unit *jumppoint, float fly_speed, bool aft );
80 };
81 
82 class AIPatrol : public AImissionScript
83 {
84 public: AIPatrol( int mode, const QVector &area, float range, Unit *around_unit, float patrol_speed );
85 };
86 
88 {
89 public: AIPatrolDefend( int mode, const QVector &area, float range, Unit *around_unit, float patrol_speed );
90 };
91 
93 {
94 public: AISuperiority();
95 };
96 
98 {
99 public: AIOrderList( olist_t *orderlist );
100 
101  virtual olist_t * getOrderList()
102  {
103  return my_orderlist;
104  }
105 private:
106  olist_t *my_orderlist;
107 };
108 
109 #endif
110