12#ifndef TT_INCLUDE__REFINERYGAMEOBJ_H
13#define TT_INCLUDE__REFINERYGAMEOBJ_H
15#include "BuildingGameObj.h"
17#include "OBBoxClass.h"
18#include "RefineryGameObjDef.h"
21class RefineryGameObjDef;
22class RefineryGameObj :
public BuildingGameObj
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);
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()
58 AllowHarvesterSpawn =
false;
60 void Allow_Harvester_Spawn()
62 AllowHarvesterSpawn =
true;
64 static float HarvesterDumpRate;
66 void Load_Variables (ChunkLoadClass &cload);
67 HarvesterClass * Harvester;
68 OBBoxClass TiberiumField;
69 bool IsHarvesterDocked;
71 int UnloadAnimationID;
74 float DistributionTimer;
76 AudibleSoundClass * MoneyTrickleSound;
77 bool AllowHarvesterSpawn;
78 ReferencerClass HarvesterVehicle;
79 float accumulatedDumpCredits;