Tiberian Technologies Scripts Reference Revision: 9000
Loading...
Searching...
No Matches
TeamPurchaseSettingsDefClass.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_TEAMPURCHASESETTINGSDEFCLASS_H
13#define TT_INCLUDE_TEAMPURCHASESETTINGSDEFCLASS_H
14#include "Definition.h"
15#include "Engine_String.h"
16#ifndef TTLE_EXPORTS
17#include "TranslateDBClass.h"
18#endif
19#include "NetworkObjectClass.h"
20#include "ExtendedNetworkObject.h"
21#define PTTEAM(t) (t?0:1) //Convert a normal team into a PT team
22class TeamPurchaseSettingsDefClass abstract : public DefinitionClass, public NetworkObjectClass {
23public:
24 enum TEAM {
25 TEAM_GDI,
26 TEAM_NOD
27 };
28 TeamPurchaseSettingsDefClass();
29 ~TeamPurchaseSettingsDefClass();
30 void setDirtyBitsForClient(const int clientId);
31 const PersistFactoryClass &Get_Factory() const;
32 bool Save(ChunkSaveClass &csave);
33 bool Load(ChunkLoadClass &cload);
34 void Load_Variables(ChunkLoadClass &cload);
35 uint32 Get_Class_ID() const;
36 virtual PersistClass *Create() const;
37 static SCRIPTS_API TeamPurchaseSettingsDefClass *Get_Definition(TEAM team);
38#ifdef DDBEDIT
39 virtual void Dump (FileClass &file);
40#endif
41 DECLARE_EDITABLE(TeamPurchaseSettingsDefClass,DefinitionClass);
42 void Delete(void)
43 {
44 }
45 void Set_Delete_Pending()
46 {
47 }
48 unsigned int Get_Network_Class_ID () const { return 2005; }
49#ifndef TTLE_EXPORTS
50#ifndef DDBEDIT
51#ifndef W3DVIEWER
52 void Export_Occasional(BitStreamClass &packet);
53 void Import_Occasional(BitStreamClass &packet);
54#endif
55#endif
56 const wchar_t *Get_Enlisted_Name(int index)
57 {
58 if (index >= 0 && (index < 4))
59 {
60 return TRANSLATE(stringids[index]);
61 }
62 return 0;
63 }
64 unsigned int Get_Enlisted_String(int index)
65 {
66 return stringids[index];
67 }
68 TEAM Get_Team()
69 {
70 return team;
71 }
72 int Get_Enlisted_Cost(int index)
73 {
74 return costs[index];
75 }
76 int Get_Enlisted_Definition(int index)
77 {
78 return presetids[index];
79 }
80 const char *Get_Enlisted_Texture(int index)
81 {
82 return textures[index];
83 }
84 unsigned int Get_Beacon_String()
85 {
86 return beaconstringid;
87 }
88 const wchar_t *Get_Beacon_Name()
89 {
90 return TRANSLATE(beaconstringid);
91 }
92 int Get_Beacon_Cost()
93 {
94 return beaconcost;
95 }
96 int Get_Beacon_Definition()
97 {
98 return beaconpresetid;
99 }
100 const char *Get_Beacon_Texture()
101 {
102 return beacontexture;
103 }
104 unsigned int Get_Supply_String()
105 {
106 return refillstringid;
107 }
108 const wchar_t *Get_Supply_Name()
109 {
110 return TRANSLATE(refillstringid);
111 }
112 const char *Get_Supply_Texture()
113 {
114 return refilltexture;
115 }
116 bool Get_Hidden(int index)
117 {
118 return Hidden[index];
119 }
120 bool Get_Disabled(int index)
121 {
122 return Disabled[index];
123 }
124 bool Get_Busy(int index)
125 {
126 return Busy[index];
127 }
128 void Set_Hidden(int index, bool b)
129 {
130 Hidden[index] = b;
131 Set_Object_Dirty_Bit(BIT_OCCASIONAL,true);
132 }
133 void Set_Disabled(int index, bool b)
134 {
135 Disabled[index] = b;
136 Set_Object_Dirty_Bit(BIT_OCCASIONAL,true);
137 }
138 void Set_Busy(int index, bool b)
139 {
140 Busy[index] = b;
141 Set_Object_Dirty_Bit(BIT_OCCASIONAL,true);
142 }
143#endif
144private:
145 TEAM team;
146 int costs[4];
147 int presetids[4];
148 unsigned int stringids[4];
149 StringClass textures[4];
150 bool Hidden[4];
151 bool Disabled[4];
152 bool Busy[4];
153 int beaconcost;
154 int beaconpresetid;
155 unsigned int beaconstringid;
156 StringClass beacontexture;
157 unsigned int refillstringid;
158 StringClass refilltexture;
159 static TeamPurchaseSettingsDefClass *DefinitionArray[2];
160 friend class PresetDump;
161};
162
163IMPLEMENT_EXTENDED_NETWORK_OBJECT(TeamPurchaseSettingsDefClass);
164
165#endif