Tiberian Technologies Scripts Reference Revision: 9000
Loading...
Searching...
No Matches
VehicleFactoryGameObj.h
1/* Renegade Scripts.dll
2 Copyright 2013 Tiberian Technologies
3
4 This file is part of the Renegade scripts.dll
5 The Renegade scripts.dll is free software; you can redistribute it and/or modify it under
6 the terms of the GNU General Public License as published by the Free
7 Software Foundation; either version 2, or (at your option) any later
8 version. See the file COPYING for more details.
9 In addition, an exemption is given to allow Run Time Dynamic Linking of this code with any closed source module that does not contain code covered by this licence.
10 Only the source code to the module(s) containing the licenced code has to be released.
11*/
12#ifndef TT_INCLUDE__VEHICLEFACTORYGAMEOBJ_H
13#define TT_INCLUDE__VEHICLEFACTORYGAMEOBJ_H
14
15#include "BuildingGameObj.h"
16#include "Matrix3D.h"
17#include "OBBoxClass.h"
18class VehicleFactoryGameObjDef;
19class VehicleFactoryGameObj : public BuildingGameObj
20{
21public:
22 VehicleFactoryGameObj (void);
23 ~VehicleFactoryGameObj (void);
24 virtual void Init( void );
25 void Init (const VehicleFactoryGameObjDef & definition);
26 SCRIPTS_API const VehicleFactoryGameObjDef & Get_Definition (void) const;
27 VehicleFactoryGameObj * As_VehicleFactoryGameObj (void) { return this; }
28 bool Save (ChunkSaveClass &csave);
29 bool Load (ChunkLoadClass &cload);
30 const PersistFactoryClass & Get_Factory (void) const;
31 void CnC_Initialize (BaseControllerClass *base);
32 void On_Destroyed (void);
33 void On_Revived (void);
34 void Think (void);
35 bool Is_Available (void) const { return !IsBusy && !IsDestroyed && !IsDisabled && !GeneratingVehicleID && !Vehicle; }
36 bool Is_Available_For_Purchase (void) const;
37 bool Is_Busy (void) const { return IsBusy; }
38 bool Is_Disabled (void) const { return IsDisabled != 0; }
39 void Set_Disabled(bool disabled) { IsDisabled = disabled; Set_Object_Dirty_Bit (BIT_RARE, true);}
40 int Get_Team_Vehicle_Count(void) const;
41 bool SCRIPTS_API Request_Vehicle (int defintion_id, float generation_time,SoldierGameObj * player = NULL);
42 const Matrix3D & Get_Creation_TM (void) { return CreationTM; }
43 void Set_Creation_TM (const Matrix3D &tm) { CreationTM = tm; }
44 void Import_Rare (BitStreamClass &packet);
45 void Export_Rare (BitStreamClass &packet);
46 static void Set_Max_Vehicles_Per_Team(int max) { MaxVehiclesPerTeam = max; }
47 static int Get_Max_Vehicles_Per_Team(void) { return MaxVehiclesPerTeam; }
48 void Set_Busy(bool busy)
49 {
50 IsBusy = busy;
51 Set_Object_Dirty_Bit(NetworkObjectClass::BIT_RARE,true);
52 }
53protected:
54 void Load_Variables (ChunkLoadClass &cload);
55 virtual void Destroy_Blocking_Objects (void);
56 void Deliver_Vehicle(void);
57 VehicleGameObj * Create_Vehicle (void);
58 virtual void Begin_Generation (void) {};
59 virtual void On_Generation_Complete (void);
60 ReferencerClass Vehicle;
61 Matrix3D CreationTM;
62 OBBoxClass GeneratingRegion;
63 float GenerationTime;
64 int GeneratingVehicleID;
65 bool IsBusy;
66 bool IsDisabled;
67 ReferencerClass Purchaser;
68 int LastDeliveryPath;
69 int LastFlyingDeliveryPath;
70 float EndTimer;
71 static int MaxVehiclesPerTeam;
72}; // 08CC
73
74
75#endif