Tiberian Technologies Scripts Reference Revision: 9000
Loading...
Searching...
No Matches
RefineryGameObj.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__REFINERYGAMEOBJ_H
13#define TT_INCLUDE__REFINERYGAMEOBJ_H
14
15#include "BuildingGameObj.h"
16#include "Matrix3D.h"
17#include "OBBoxClass.h"
18#include "RefineryGameObjDef.h"
19
20class HarvesterClass;
21class RefineryGameObjDef;
22class RefineryGameObj : public BuildingGameObj
23{
24public:
25 RefineryGameObj (void);
26 ~RefineryGameObj (void);
27 virtual void Init( void );
28 void Init (const RefineryGameObjDef & definition);
29 const RefineryGameObjDef SCRIPTS_API & Get_Definition (void) const;
30 RefineryGameObj * As_RefineryGameObj (void) { return this; }
31 bool Save (ChunkSaveClass &csave);
32 bool Load (ChunkLoadClass &cload);
33 const PersistFactoryClass & Get_Factory (void) const;
34 void CnC_Initialize (BaseControllerClass *base);
35 void On_Destroyed (void);
36 void Think (void);
37 void Manage_Money_Trickle_Sound (void);
38 bool Needs_Harvester (void) const { return (!IsDestroyed) && (Harvester == NULL); }
39 int Get_Harvester_Def_ID (void) const { return Get_Definition ().HarvesterDefID; }
40 void Set_Is_Harvester_Docked(bool flag);
41 bool Get_Is_Harvester_Docked(void) { return IsHarvesterDocked; }
42 VehicleGameObj * Get_Harvester_Vehicle (void);
43 void Set_Harvester_Vehicle (VehicleGameObj *harvester);
44 HarvesterClass * Get_Harvester (void) { return Harvester; }
45 void Set_Harvester (HarvesterClass *harvester) { Harvester = harvester; }
46 void On_Harvester_Docked (void);
47 void On_Harvester_Damaged(VehicleGameObj*);
48 void On_Harvester_Destroyed(VehicleGameObj*);
49 void Play_Unloading_Animation (bool onoff);
50 const Matrix3D & Get_Dock_TM (void) const { return DockTM; }
51 void Set_Dock_TM (const Matrix3D &tm) { DockTM = tm; }
52 virtual void Export_Rare (BitStreamClass &packet);
53 virtual void Import_Rare (BitStreamClass &packet);
54 void Destroy_Harvester();
55 void Block_Harvester_Spawn()
56 {
57 Destroy_Harvester();
58 AllowHarvesterSpawn = false;
59 }
60 void Allow_Harvester_Spawn()
61 {
62 AllowHarvesterSpawn = true;
63 }
64 static float HarvesterDumpRate;
65private:
66 void Load_Variables (ChunkLoadClass &cload);
67 HarvesterClass * Harvester;
68 OBBoxClass TiberiumField;
69 bool IsHarvesterDocked;
70 float UnloadTimer;
71 int UnloadAnimationID;
72 float TotalFunds;
73 float FundsPerSecond;
74 float DistributionTimer;
75 Matrix3D DockTM;
76 AudibleSoundClass * MoneyTrickleSound;
77 bool AllowHarvesterSpawn;
78 ReferencerClass HarvesterVehicle;
79 float accumulatedDumpCredits;
80 float DumpRate;
81}; // 2232, RH7 2252
82
83
84#endif