[go: up one dir, main page]

Menu

[r43]: / trunk / core / model.pas  Maximize  Restore  History

Download this file

247 lines (208 with data), 6.6 kB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
unit Model;
{$MODE ObjFpc}
{$H+}
{$M+}
interface
uses
Classes, SysUtils, Fgl,
(* project libs *)
EasySqliteOrm;
type
TBaseObject = class(TObject)
private
FId: Integer;
FName: String;
published
property Id: Integer read FId write FId;
property Name: String read FName write FName;
end;
TSetting = class(TObject)
private
FKey: String;
FValue: String;
public
property Key: String read FKey write FKey;
property Value: String read FValue write FValue;
end;
TSettingList = class(specialize TFPGObjectList<TSetting>, IObjectContainer)
public
procedure AddObject(AnObject: TObject);
end;
TPage = class(TBaseObject)
private
FContent: String;
FContentType: Integer;
FImageId: Integer;
FPageType: Integer;
FTitle: String;
published
property PageType: Integer read FPageType write FPageType;
property Title: String read FTitle write FTitle;
property Content: String read FContent write FContent;
property ContentType: Integer read FContentType write FContentType;
property ImageId: Integer read FImageId write FImageId;
end;
TPageList = class(specialize TFPGObjectList<TPage>, IObjectContainer)
public
procedure AddObject(AnObject: TObject);
end;
TPageExit = class(TObject)
private
FCaption: String;
FIsCOnditional: Boolean;
FPageId: Integer;
FTargetPageId: Integer;
published
property PageId: Integer read FPageId write FPageId;
property TargetPageId: Integer read FTargetPageId write FTargetPageId;
property Caption: String read FCaption write FCaption;
property IsConditional: Boolean read FIsCOnditional write FIsCOnditional;
end;
TPageExitList = class(specialize TFPGObjectList<TPageExit>, IObjectContainer)
public
procedure AddObject(AnObject: TObject);
end;
TPageExitCondition = class(TBaseObject)
private
FConditionObjectId: Integer;
FConditionType: Integer;
FConditionValue: Integer;
FPageExitId: Integer;
published
property PageExitId: Integer read FPageExitId write FPageExitId;
property ConditionType: Integer read FConditionType write FConditionType;
property ConditionObjectId: Integer read FConditionObjectId write FConditionObjectId;
property ConditionValue: Integer read FConditionValue write FConditionValue;
end;
TPageExitConditionList = class(specialize TFPGObjectList<TPageExitCondition>, IObjectContainer)
public
procedure AddObject(AnObject: TObject);
end;
TAction = class(TBaseObject)
private
FActionObjectId: Integer;
FActionType: Integer;
FActionValue: String;
FPageId: Integer;
published
property PageId: Integer read FPageId write FPageId;
property ActionType: Integer read FActionType write FActionType;
property ActionObjectId: Integer read FActionObjectId write FActionObjectId;
property ActionValue: String read FActionValue write FActionValue;
end;
TActionList = class(specialize TFPGObjectList<TAction>, IObjectContainer)
public
procedure AddObject(AnObject: TObject);
end;
TAttribute = class(TBaseObject)
private
FCaption: String;
FDeathType: Integer;
FDeathValue: Integer;
FImageId: Integer;
FIsVisible: Boolean;
FMaxValue: Integer;
FMinValue: Integer;
published
property Caption: String read FCaption write FCaption;
property ImageId: Integer read FImageId write FImageId;
property IsVisible: Boolean read FIsVisible write FIsVisible;
property MaxValue: Integer read FMaxValue write FMaxValue;
property MinValue: Integer read FMinValue write FMinValue;
property DeathType: Integer read FDeathType write FDeathType;
property DeathValue: Integer read FDeathValue write FDeathValue;
end;
TAttributeList = class(specialize TFPGObjectList<TAttribute>, IObjectContainer)
public
procedure AddObject(AnObject: TObject);
end;
TItem = class(TBaseObject)
private
FCaption: String;
FImageId: Integer;
FIsVisible: Boolean;
published
property Caption: String read FCaption write FCaption;
property ImageId: Integer read FImageId write FImageId;
property IsVisible: Boolean read FIsVisible write FIsVisible;
end;
TItemList = class(specialize TFPGObjectList<TItem>, IObjectContainer)
public
procedure AddObject(AnObject: TObject);
end;
TImageFolder = class(TBaseObject);
TImageFolderList = class(specialize TFPGObjectList<TImageFolder>, IObjectContainer)
public
procedure AddObject(AnObject: TObject);
end;
TImage = class(TBaseObject)
private
FData: String;
FImageFolderId: Integer;
published
property ImageFolderId: Integer read FImageFolderId write FImageFolderId;
property Data: String read FData write FData;
end;
TImageList = class(specialize TFPGObjectList<TImage>, IObjectContainer)
public
procedure AddObject(AnObject: TObject);
end;
const
ACTIONTYPE_INC_ATTRIBUTE = 0;
ACTIONTYPE_DEC_ATTRIBUTE = 1;
ACTIONTYPE_ENABLE_ITEM = 2;
ACTIONTYPE_DISABLE_ITEM = 3;
ACTIONTYPE_SWITCH_ITEM = 4;
CONDITIONTYPE_ITEM_EXISTANT = 0;
CONDITIONTYPE_ITEM_NONEXISTANT = 1;
CONDITIONTYPE_ATTRIBUTE_HIGHER = 2;
CONDITIONTYPE_ATTRIBUTE_LOWER = 3;
CONDITIONTYPE_ATTRIBUTE_EQUAL = 4;
CONTENTTYPE_PLAINTEXT = 0;
CONTENTTYPE_HTML = 1;
CONTENTTYPE_FIGHT = 2;
DEATHTYPE_NONE = 0;
DEATHTYPE_IF_LOWER = 1;
DEATHTYPE_IF_HIGHER = 2;
PAGETYPE_STANDARD = 0;
PAGETYPE_STARTPAGE = 1;
PAGETYPE_WINPAGE = 2;
PAGETYPE_FAILPAGE =3;
implementation
procedure TActionList.AddObject(AnObject: TObject);
begin
Self.Add(AnObject as TAction);
end;
procedure TSettingList.AddObject(AnObject: TObject);
begin
Self.Add(AnObject as TSetting);
end;
procedure TImageList.AddObject(AnObject: TObject);
begin
Self.Add(AnObject as TImage);
end;
procedure TImageFolderList.AddObject(AnObject: TObject);
begin
Self.Add(AnObject as TImageFolder);
end;
procedure TItemList.AddObject(AnObject: TObject);
begin
Self.Add(AnObject as TItem);
end;
procedure TAttributeList.AddObject(AnObject: TObject);
begin
Self.Add(AnObject as TAttribute);
end;
procedure TPageExitConditionList.AddObject(AnObject: TObject);
begin
Self.Add(AnObject as TPageExitCondition);
end;
procedure TPageExitList.AddObject(AnObject: TObject);
begin
Self.Add(AnObject as TPageExit);
end;
procedure TPageList.AddObject(AnObject: TObject);
begin
Self.Add(AnObject as TPage);
end;
end.