Tiberian Technologies Scripts Reference Revision: 9000
Loading...
Searching...
No Matches
BaseGameObj.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#pragma once
13
14#include "NetworkObjectClass.h"
15#include "DataSafe.h"
16#include "Persist.h"
17
18class PhysicalGameObj;
19class VehicleGameObj;
20class SmartGameObj;
21class ScriptableGameObj;
22class DefinitionClass;
23class BaseGameObjDef;
24
25class BaseGameObj: public PersistClass, public NetworkObjectClass
26{
27public:
28
29 BaseGameObj();
30 virtual ~BaseGameObj();
31
32 virtual void Init() = 0;
33 void Init(const BaseGameObjDef & definition);
34
35 virtual bool Save(ChunkSaveClass& csave);
36 virtual bool Load(ChunkLoadClass& cload);
37 virtual void Think() { IsPostThinkAllowed = true; }
38 virtual void Post_Think() {};
39 virtual bool Is_Hibernating() { return false; }
40
41 virtual PhysicalGameObj* As_PhysicalGameObj() { return nullptr; }
42 virtual VehicleGameObj* As_VehicleGameObj() { return nullptr; }
43 virtual SmartGameObj* As_SmartGameObj() { return nullptr; }
44 virtual ScriptableGameObj* As_ScriptableGameObj() { return nullptr; }
45
46 virtual uint32 Get_Network_Class_ID() const { return 0x3E8; }
47 virtual void Delete() { delete this; }
48
49 const BaseGameObjDef& Get_Definition() const { return *Definition; };
50 void Set_ID(int id) { Set_Network_ID(id); }
51 int Get_ID() const { return Get_Network_ID(); }
52
53 bool Is_Post_Think_Allowed() { return IsPostThinkAllowed; }
54 void Enable_Cinematic_Freeze(bool enable) { EnableCinematicFreeze = enable; }
55 bool Is_Cinematic_Freeze_Enabled() { return EnableCinematicFreeze; }
56
57private:
58
59 const BaseGameObjDef* Definition; // 06BC
60 bool IsPostThinkAllowed; // 06C0
61 bool EnableCinematicFreeze; // 06C1
62
63};// 06C2