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_customize.h
Go to the documentation of this file.
1 #ifndef __UNIT_CUSTOMIZE_CPP__
2 #define __UNIT_CUSTOMIZE_CPP__
3 
4 #include "unit.h"
5 #include "unit_factory.h"
6 #include "images.h"
7 #include "universe.h"
8 #include "vegastrike.h"
9 #include <stdio.h>
10 #include <stdlib.h>
11 #include "gfx/cockpit.h"
12 #include "savegame.h"
13 #include "config_xml.h"
14 #include "xml_serializer.h"
15 #include "audiolib.h"
16 #include "vs_globals.h"
17 #include "unit_const_cache.h"
18 #ifdef _WIN32
19 #define strcasecmp stricmp
20 #endif
21 extern int GetModeFromName( const char* );
22 
23 extern Unit * CreateGameTurret( std::string tur, int faction );
24 
25 template < class UnitType >
27  int subunitoffset,
28  bool touchme,
29  bool downgrade,
30  int &numave,
31  double &percentage )
32 {
33  bool bl = this->UpgradeSubUnitsWithFactory( up, subunitoffset, touchme, downgrade, numave, percentage, &CreateGameTurret );
34  if ( !up->SubUnits.empty() )
35  this->DisableTurretAI();
36  return bl;
37 }
38 
39 extern char * GetUnitDir( const char* );
40 
41 template < class UnitType >
42 double GameUnit< UnitType >::Upgrade( const std::string &file,
43  int mountoffset,
44  int subunitoffset,
45  bool force,
46  bool loop_through_mounts )
47 {
48  return Unit::Upgrade( file, mountoffset, subunitoffset, force, loop_through_mounts );
49 }
50 
51 #endif
52