-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinit_controller.e
613 lines (581 loc) · 25.8 KB
/
init_controller.e
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
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
note
description : "XML Loader for the game themes and configuration."
author : "Louis Marchand"
date : "July 19 2012"
revision : "1.0"
class
INIT_CONTROLLER
create
make
feature {NONE} -- Initialization
make
-- Initialization for `Current'.
local
init_file_name:STRING
pars:XML_STANDARD_PARSER
tree_pipe: XML_CALLBACKS_DOCUMENT
do
has_error:=false
is_theme_set:=false
init_file_name:="./init.xml"
create pars.make
create tree_pipe.make_null
pars.set_callbacks (tree_pipe)
pars.parse_from_path (create {PATH}.make_from_string(init_file_name))
if pars.error_occurred then
has_error:=true
io.error.put_string (pars.error_message)
io.error.flush
else
set_default_value
process_document(tree_pipe.document)
if not is_theme_set then
has_error:=true
io.error.put_string ("Error: init.xml file not valid!%N")
io.error.flush
end
end
ensure
Init_Controller_No_Error_Found:not has_error
end
set_default_value
-- Assign default values to status flags of `Current'
do
is_material_video_memory:=false
is_material_double_buffer:=false
is_ghost_show:=false
is_font_cpf:=true
custom_control_enable:=false
is_sound_thread:=false
end
process_document(document:XML_DOCUMENT)
-- Get values from a `document'
local
elements:LIST[XML_ELEMENT]
do
if document.root_element.name.is_equal ("init") then
elements:=document.root_element.elements
from
elements.start
until
elements.off
loop
process_element(elements.item_for_iteration)
elements.forth
end
end
end
process_element(element:XML_ELEMENT)
-- Get values from a specific `element'
do
if element.name.is_equal ("theme") then
process_theme_element(element)
elseif element.name.is_equal ("material") then
process_material_element(element)
elseif element.name.is_equal ("ghost") then
process_ghost_element(element)
elseif element.name.is_equal ("cpf") then
process_cpf_element(element)
elseif element.name.is_equal ("custom_control") then
process_custom_control_element(element)
elseif element.name.is_equal ("sound") then
process_sound_element(element)
end
end
process_material_element(element:XML_ELEMENT)
-- Get material values from `element'
local
attributes:LIST[XML_ATTRIBUTE]
do
attributes:=element.attributes
from
attributes.start
until
attributes.off
loop
if attributes.item_for_iteration.name.is_equal ("video_memory") then
is_material_video_memory:=attributes.item_for_iteration.value.is_equal ("true")
elseif attributes.item_for_iteration.name.is_equal ("double_buffer") then
is_material_double_buffer:=attributes.item_for_iteration.value.is_equal ("true")
end
attributes.forth
end
end
process_theme_element(element:XML_ELEMENT)
-- Get theme values from `element'
local
is_theme_name_set:BOOLEAN
attributes:LIST[XML_ATTRIBUTE]
do
is_theme_set:=false
attributes:=element.attributes
from
attributes.start
until
attributes.off
loop
if attributes.item_for_iteration.name.is_equal ("name") then
theme_name:=attributes.item_for_iteration.value
is_theme_name_set:=true
end
attributes.forth
end
is_theme_set:=is_theme_name_set
end
process_ghost_element(element:XML_ELEMENT)
-- Get tetrominos ghosts values from `element'
local
attributes:LIST[XML_ATTRIBUTE]
do
attributes:=element.attributes
from
attributes.start
until
attributes.off
loop
if attributes.item_for_iteration.name.is_equal ("show") then
is_ghost_show:=attributes.item_for_iteration.value.is_equal ("true")
end
attributes.forth
end
end
process_cpf_element(element:XML_ELEMENT)
-- Get fonts values from `element'
local
attributes:LIST[XML_ATTRIBUTE]
do
attributes:=element.attributes
from
attributes.start
until
attributes.off
loop
if attributes.item_for_iteration.name.is_equal ("font") then
is_font_cpf:=attributes.item_for_iteration.value.is_equal ("true")
end
attributes.forth
end
end
process_custom_control_element(element:XML_ELEMENT)
-- Get controls values from `element'
local
elements:LIST[XML_ELEMENT]
do
custom_control_enable:=true
create custom_control_ctrl.make
elements:=element.elements
from
elements.start
until
elements.off
loop
if elements.item.name.is_equal ("keyboard") then
process_custom_control_keyboard_element(elements.item)
elseif elements.item.name.is_equal ("joystick") then
process_custom_control_joystick_element(elements.item)
end
elements.forth
end
end
process_custom_control_keyboard_element(element:XML_ELEMENT)
-- Get keyboard control values from `element'
local
attributes:LIST[XML_ATTRIBUTE]
do
custom_control_ctrl.enable_keyboard
attributes:=element.attributes
from
attributes.start
until
attributes.off
loop
if attributes.item_for_iteration.name.is_equal ("menu_up") then
if attributes.item_for_iteration.value.is_natural_8 then
custom_control_ctrl.keyboard_menu_up:=attributes.item_for_iteration.value.to_natural_8
end
elseif attributes.item_for_iteration.name.is_equal ("menu_down") then
if attributes.item_for_iteration.value.is_natural_8 then
custom_control_ctrl.keyboard_menu_down:=attributes.item_for_iteration.value.to_natural_8
end
elseif attributes.item_for_iteration.name.is_equal ("menu_left") then
if attributes.item_for_iteration.value.is_natural_8 then
custom_control_ctrl.keyboard_menu_left:=attributes.item_for_iteration.value.to_natural_8
end
elseif attributes.item_for_iteration.name.is_equal ("menu_right") then
if attributes.item_for_iteration.value.is_natural_8 then
custom_control_ctrl.keyboard_menu_right:=attributes.item_for_iteration.value.to_natural_8
end
elseif attributes.item_for_iteration.name.is_equal ("menu_enter") then
if attributes.item_for_iteration.value.is_natural_8 then
custom_control_ctrl.keyboard_menu_enter:=attributes.item_for_iteration.value.to_natural_8
end
elseif attributes.item_for_iteration.name.is_equal ("menu_back") then
if attributes.item_for_iteration.value.is_natural_8 then
custom_control_ctrl.keyboard_menu_back:=attributes.item_for_iteration.value.to_natural_8
end
elseif attributes.item_for_iteration.name.is_equal ("game_left") then
if attributes.item_for_iteration.value.is_natural_8 then
custom_control_ctrl.keyboard_game_left:=attributes.item_for_iteration.value.to_natural_8
end
elseif attributes.item_for_iteration.name.is_equal ("game_right") then
if attributes.item_for_iteration.value.is_natural_8 then
custom_control_ctrl.keyboard_game_right:=attributes.item_for_iteration.value.to_natural_8
end
elseif attributes.item_for_iteration.name.is_equal ("game_down") then
if attributes.item_for_iteration.value.is_natural_8 then
custom_control_ctrl.keyboard_game_down:=attributes.item_for_iteration.value.to_natural_8
end
elseif attributes.item_for_iteration.name.is_equal ("game_drop") then
if attributes.item_for_iteration.value.is_natural_8 then
custom_control_ctrl.keyboard_game_drop:=attributes.item_for_iteration.value.to_natural_8
end
elseif attributes.item_for_iteration.name.is_equal ("game_rotate_left") then
if attributes.item_for_iteration.value.is_natural_8 then
custom_control_ctrl.keyboard_game_rotate_left:=attributes.item_for_iteration.value.to_natural_8
end
elseif attributes.item_for_iteration.name.is_equal ("game_rotate_right") then
if attributes.item_for_iteration.value.is_natural_8 then
custom_control_ctrl.keyboard_game_rotate_right:=attributes.item_for_iteration.value.to_natural_8
end
elseif attributes.item_for_iteration.name.is_equal ("game_hold") then
if attributes.item_for_iteration.value.is_natural_8 then
custom_control_ctrl.keyboard_game_hold:=attributes.item_for_iteration.value.to_natural_8
end
elseif attributes.item_for_iteration.name.is_equal ("game_pause") then
if attributes.item_for_iteration.value.is_natural_8 then
custom_control_ctrl.keyboard_game_pause:=attributes.item_for_iteration.value.to_natural_8
end
end
attributes.forth
end
end
process_custom_control_joystick_element(element:XML_ELEMENT)
-- Get joystick control values from `element'
local
attributes:LIST[XML_ATTRIBUTE]
elements:LIST[XML_ELEMENT]
do
custom_control_ctrl.enable_joystick
attributes:=element.attributes
from
attributes.start
until
attributes.off
loop
if attributes.item_for_iteration.name.is_equal ("device_id") then
if attributes.item_for_iteration.value.is_natural_8 then
custom_control_ctrl.joystick_device_id :=attributes.item_for_iteration.value.to_natural_8
end
end
attributes.forth
end
elements:=element.elements
from
elements.start
until
elements.off
loop
if elements.item.name.is_equal ("buttons") then
process_custom_control_joystick_buttons_element(elements.item)
elseif elements.item.name.is_equal ("axis") then
process_custom_control_joystick_axis_element(elements.item)
end
elements.forth
end
end
process_custom_control_joystick_buttons_element(element:XML_ELEMENT)
-- Get joystick buttons control values from `element'
local
attributes:LIST[XML_ATTRIBUTE]
do
custom_control_ctrl.enable_joystick_buttons
attributes:=element.attributes
from
attributes.start
until
attributes.off
loop
if attributes.item_for_iteration.name.is_equal ("menu_up") then
if attributes.item_for_iteration.value.is_natural_8 then
custom_control_ctrl.joystick_button_menu_up:=attributes.item_for_iteration.value.to_natural_8
end
elseif attributes.item_for_iteration.name.is_equal ("menu_down") then
if attributes.item_for_iteration.value.is_natural_8 then
custom_control_ctrl.joystick_button_menu_down:=attributes.item_for_iteration.value.to_natural_8
end
elseif attributes.item_for_iteration.name.is_equal ("menu_left") then
if attributes.item_for_iteration.value.is_natural_8 then
custom_control_ctrl.joystick_button_menu_left:=attributes.item_for_iteration.value.to_natural_8
end
elseif attributes.item_for_iteration.name.is_equal ("menu_right") then
if attributes.item_for_iteration.value.is_natural_8 then
custom_control_ctrl.joystick_button_menu_right:=attributes.item_for_iteration.value.to_natural_8
end
elseif attributes.item_for_iteration.name.is_equal ("menu_enter") then
if attributes.item_for_iteration.value.is_natural_8 then
custom_control_ctrl.joystick_button_menu_enter:=attributes.item_for_iteration.value.to_natural_8
end
elseif attributes.item_for_iteration.name.is_equal ("menu_back") then
if attributes.item_for_iteration.value.is_natural_8 then
custom_control_ctrl.joystick_button_menu_back:=attributes.item_for_iteration.value.to_natural_8
end
elseif attributes.item_for_iteration.name.is_equal ("game_left") then
if attributes.item_for_iteration.value.is_natural_8 then
custom_control_ctrl.joystick_button_game_left:=attributes.item_for_iteration.value.to_natural_8
end
elseif attributes.item_for_iteration.name.is_equal ("game_right") then
if attributes.item_for_iteration.value.is_natural_8 then
custom_control_ctrl.joystick_button_game_right:=attributes.item_for_iteration.value.to_natural_8
end
elseif attributes.item_for_iteration.name.is_equal ("game_down") then
if attributes.item_for_iteration.value.is_natural_8 then
custom_control_ctrl.joystick_button_game_down:=attributes.item_for_iteration.value.to_natural_8
end
elseif attributes.item_for_iteration.name.is_equal ("game_drop") then
if attributes.item_for_iteration.value.is_natural_8 then
custom_control_ctrl.joystick_button_game_drop:=attributes.item_for_iteration.value.to_natural_8
end
elseif attributes.item_for_iteration.name.is_equal ("game_rotate_left") then
if attributes.item_for_iteration.value.is_natural_8 then
custom_control_ctrl.joystick_button_game_rotate_left:=attributes.item_for_iteration.value.to_natural_8
end
elseif attributes.item_for_iteration.name.is_equal ("game_rotate_right") then
if attributes.item_for_iteration.value.is_natural_8 then
custom_control_ctrl.joystick_button_game_rotate_right:=attributes.item_for_iteration.value.to_natural_8
end
elseif attributes.item_for_iteration.name.is_equal ("game_hold") then
if attributes.item_for_iteration.value.is_natural_8 then
custom_control_ctrl.joystick_button_game_hold:=attributes.item_for_iteration.value.to_natural_8
end
elseif attributes.item_for_iteration.name.is_equal ("game_pause") then
if attributes.item_for_iteration.value.is_natural_8 then
custom_control_ctrl.joystick_button_game_pause:=attributes.item_for_iteration.value.to_natural_8
end
end
attributes.forth
end
end
process_custom_control_joystick_axis_element(element:XML_ELEMENT)
-- Get joystck buttons control values from `element'
local
attributes:LIST[XML_ATTRIBUTE]
do
custom_control_ctrl.enable_joystick_axis
attributes:=element.attributes
from
attributes.start
until
attributes.off
loop
if attributes.item_for_iteration.name.is_equal ("menu_up_lower_than") then
if attributes.item_for_iteration.value.is_integer_16 then
custom_control_ctrl.joystick_axis_menu_up.lower_than:=attributes.item_for_iteration.value.to_integer_16
end
elseif attributes.item_for_iteration.name.is_equal ("menu_up_upper_than") then
if attributes.item_for_iteration.value.is_integer_16 then
custom_control_ctrl.joystick_axis_menu_up.upper_than:=attributes.item_for_iteration.value.to_integer_16
end
elseif attributes.item_for_iteration.name.is_equal ("menu_up_axis_id") then
if attributes.item_for_iteration.value.is_natural_8 then
custom_control_ctrl.joystick_axis_menu_up.axis_id :=attributes.item_for_iteration.value.to_natural_8
end
elseif attributes.item_for_iteration.name.is_equal ("menu_down_lower_than") then
if attributes.item_for_iteration.value.is_integer_16 then
custom_control_ctrl.joystick_axis_menu_down.lower_than:=attributes.item_for_iteration.value.to_integer_16
end
elseif attributes.item_for_iteration.name.is_equal ("menu_down_upper_than") then
if attributes.item_for_iteration.value.is_integer_16 then
custom_control_ctrl.joystick_axis_menu_down.upper_than:=attributes.item_for_iteration.value.to_integer_16
end
elseif attributes.item_for_iteration.name.is_equal ("menu_down_axis_id") then
if attributes.item_for_iteration.value.is_natural_8 then
custom_control_ctrl.joystick_axis_menu_down.axis_id :=attributes.item_for_iteration.value.to_natural_8
end
elseif attributes.item_for_iteration.name.is_equal ("menu_left_lower_than") then
if attributes.item_for_iteration.value.is_integer_16 then
custom_control_ctrl.joystick_axis_menu_left.lower_than:=attributes.item_for_iteration.value.to_integer_16
end
elseif attributes.item_for_iteration.name.is_equal ("menu_left_upper_than") then
if attributes.item_for_iteration.value.is_integer_16 then
custom_control_ctrl.joystick_axis_menu_left.upper_than:=attributes.item_for_iteration.value.to_integer_16
end
elseif attributes.item_for_iteration.name.is_equal ("menu_left_axis_id") then
if attributes.item_for_iteration.value.is_natural_8 then
custom_control_ctrl.joystick_axis_menu_left.axis_id :=attributes.item_for_iteration.value.to_natural_8
end
elseif attributes.item_for_iteration.name.is_equal ("menu_right_lower_than") then
if attributes.item_for_iteration.value.is_integer_16 then
custom_control_ctrl.joystick_axis_menu_right.lower_than:=attributes.item_for_iteration.value.to_integer_16
end
elseif attributes.item_for_iteration.name.is_equal ("menu_right_upper_than") then
if attributes.item_for_iteration.value.is_integer_16 then
custom_control_ctrl.joystick_axis_menu_right.upper_than:=attributes.item_for_iteration.value.to_integer_16
end
elseif attributes.item_for_iteration.name.is_equal ("menu_right_axis_id") then
if attributes.item_for_iteration.value.is_natural_8 then
custom_control_ctrl.joystick_axis_menu_right.axis_id :=attributes.item_for_iteration.value.to_natural_8
end
elseif attributes.item_for_iteration.name.is_equal ("menu_enter_lower_than") then
if attributes.item_for_iteration.value.is_integer_16 then
custom_control_ctrl.joystick_axis_menu_enter.lower_than:=attributes.item_for_iteration.value.to_integer_16
end
elseif attributes.item_for_iteration.name.is_equal ("menu_enter_upper_than") then
if attributes.item_for_iteration.value.is_integer_16 then
custom_control_ctrl.joystick_axis_menu_enter.upper_than:=attributes.item_for_iteration.value.to_integer_16
end
elseif attributes.item_for_iteration.name.is_equal ("menu_enter_axis_id") then
if attributes.item_for_iteration.value.is_natural_8 then
custom_control_ctrl.joystick_axis_menu_enter.axis_id :=attributes.item_for_iteration.value.to_natural_8
end
elseif attributes.item_for_iteration.name.is_equal ("menu_back_lower_than") then
if attributes.item_for_iteration.value.is_integer_16 then
custom_control_ctrl.joystick_axis_menu_back.lower_than:=attributes.item_for_iteration.value.to_integer_16
end
elseif attributes.item_for_iteration.name.is_equal ("menu_back_upper_than") then
if attributes.item_for_iteration.value.is_integer_16 then
custom_control_ctrl.joystick_axis_menu_back.upper_than:=attributes.item_for_iteration.value.to_integer_16
end
elseif attributes.item_for_iteration.name.is_equal ("menu_back_axis_id") then
if attributes.item_for_iteration.value.is_natural_8 then
custom_control_ctrl.joystick_axis_menu_back.axis_id :=attributes.item_for_iteration.value.to_natural_8
end
elseif attributes.item_for_iteration.name.is_equal ("game_left_lower_than") then
if attributes.item_for_iteration.value.is_integer_16 then
custom_control_ctrl.joystick_axis_game_left.lower_than:=attributes.item_for_iteration.value.to_integer_16
end
elseif attributes.item_for_iteration.name.is_equal ("game_left_upper_than") then
if attributes.item_for_iteration.value.is_integer_16 then
custom_control_ctrl.joystick_axis_game_left.upper_than:=attributes.item_for_iteration.value.to_integer_16
end
elseif attributes.item_for_iteration.name.is_equal ("game_left_axis_id") then
if attributes.item_for_iteration.value.is_natural_8 then
custom_control_ctrl.joystick_axis_game_left.axis_id :=attributes.item_for_iteration.value.to_natural_8
end
elseif attributes.item_for_iteration.name.is_equal ("game_right_lower_than") then
if attributes.item_for_iteration.value.is_integer_16 then
custom_control_ctrl.joystick_axis_game_right.lower_than:=attributes.item_for_iteration.value.to_integer_16
end
elseif attributes.item_for_iteration.name.is_equal ("game_right_upper_than") then
if attributes.item_for_iteration.value.is_integer_16 then
custom_control_ctrl.joystick_axis_game_right.upper_than:=attributes.item_for_iteration.value.to_integer_16
end
elseif attributes.item_for_iteration.name.is_equal ("game_right_axis_id") then
if attributes.item_for_iteration.value.is_natural_8 then
custom_control_ctrl.joystick_axis_game_right.axis_id :=attributes.item_for_iteration.value.to_natural_8
end
elseif attributes.item_for_iteration.name.is_equal ("game_down_lower_than") then
if attributes.item_for_iteration.value.is_integer_16 then
custom_control_ctrl.joystick_axis_game_down.lower_than:=attributes.item_for_iteration.value.to_integer_16
end
elseif attributes.item_for_iteration.name.is_equal ("game_down_upper_than") then
if attributes.item_for_iteration.value.is_integer_16 then
custom_control_ctrl.joystick_axis_game_down.upper_than:=attributes.item_for_iteration.value.to_integer_16
end
elseif attributes.item_for_iteration.name.is_equal ("game_down_axis_id") then
if attributes.item_for_iteration.value.is_natural_8 then
custom_control_ctrl.joystick_axis_game_down.axis_id :=attributes.item_for_iteration.value.to_natural_8
end
elseif attributes.item_for_iteration.name.is_equal ("game_drop_lower_than") then
if attributes.item_for_iteration.value.is_integer_16 then
custom_control_ctrl.joystick_axis_game_drop.lower_than:=attributes.item_for_iteration.value.to_integer_16
end
elseif attributes.item_for_iteration.name.is_equal ("game_drop_upper_than") then
if attributes.item_for_iteration.value.is_integer_16 then
custom_control_ctrl.joystick_axis_game_drop.upper_than:=attributes.item_for_iteration.value.to_integer_16
end
elseif attributes.item_for_iteration.name.is_equal ("game_drop_axis_id") then
if attributes.item_for_iteration.value.is_natural_8 then
custom_control_ctrl.joystick_axis_game_drop.axis_id :=attributes.item_for_iteration.value.to_natural_8
end
elseif attributes.item_for_iteration.name.is_equal ("game_rotate_left_lower_than") then
if attributes.item_for_iteration.value.is_integer_16 then
custom_control_ctrl.joystick_axis_game_rotate_left.lower_than:=attributes.item_for_iteration.value.to_integer_16
end
elseif attributes.item_for_iteration.name.is_equal ("game_rotate_left_upper_than") then
if attributes.item_for_iteration.value.is_integer_16 then
custom_control_ctrl.joystick_axis_game_rotate_left.upper_than:=attributes.item_for_iteration.value.to_integer_16
end
elseif attributes.item_for_iteration.name.is_equal ("game_rotate_left_axis_id") then
if attributes.item_for_iteration.value.is_natural_8 then
custom_control_ctrl.joystick_axis_game_rotate_left.axis_id :=attributes.item_for_iteration.value.to_natural_8
end
elseif attributes.item_for_iteration.name.is_equal ("game_rotate_right_lower_than") then
if attributes.item_for_iteration.value.is_integer_16 then
custom_control_ctrl.joystick_axis_game_rotate_right.lower_than:=attributes.item_for_iteration.value.to_integer_16
end
elseif attributes.item_for_iteration.name.is_equal ("game_rotate_right_upper_than") then
if attributes.item_for_iteration.value.is_integer_16 then
custom_control_ctrl.joystick_axis_game_rotate_right.upper_than:=attributes.item_for_iteration.value.to_integer_16
end
elseif attributes.item_for_iteration.name.is_equal ("game_rotate_right_axis_id") then
if attributes.item_for_iteration.value.is_natural_8 then
custom_control_ctrl.joystick_axis_game_rotate_right.axis_id :=attributes.item_for_iteration.value.to_natural_8
end
elseif attributes.item_for_iteration.name.is_equal ("game_hold_lower_than") then
if attributes.item_for_iteration.value.is_integer_16 then
custom_control_ctrl.joystick_axis_game_hold.lower_than:=attributes.item_for_iteration.value.to_integer_16
end
elseif attributes.item_for_iteration.name.is_equal ("game_hold_upper_than") then
if attributes.item_for_iteration.value.is_integer_16 then
custom_control_ctrl.joystick_axis_game_hold.upper_than:=attributes.item_for_iteration.value.to_integer_16
end
elseif attributes.item_for_iteration.name.is_equal ("game_hold_axis_id") then
if attributes.item_for_iteration.value.is_natural_8 then
custom_control_ctrl.joystick_axis_game_hold.axis_id :=attributes.item_for_iteration.value.to_natural_8
end
elseif attributes.item_for_iteration.name.is_equal ("game_pause_lower_than") then
if attributes.item_for_iteration.value.is_integer_16 then
custom_control_ctrl.joystick_axis_game_pause.lower_than:=attributes.item_for_iteration.value.to_integer_16
end
elseif attributes.item_for_iteration.name.is_equal ("game_pause_upper_than") then
if attributes.item_for_iteration.value.is_integer_16 then
custom_control_ctrl.joystick_axis_game_pause.upper_than:=attributes.item_for_iteration.value.to_integer_16
end
elseif attributes.item_for_iteration.name.is_equal ("game_pause_axis_id") then
if attributes.item_for_iteration.value.is_natural_8 then
custom_control_ctrl.joystick_axis_game_pause.axis_id :=attributes.item_for_iteration.value.to_natural_8
end
end
attributes.forth
end
end
process_sound_element(element:XML_ELEMENT)
-- Get sound values from `element'
local
attributes:LIST[XML_ATTRIBUTE]
do
attributes:=element.attributes
from
attributes.start
until
attributes.off
loop
if attributes.item_for_iteration.name.is_equal ("thread") then
is_sound_thread:=attributes.item_for_iteration.value.is_equal ("true")
end
attributes.forth
end
end
feature -- Access
is_theme_set:BOOLEAN
-- Status that indicate that a theme has been loaded.
theme_name:STRING
-- If `is_theme_set', the name of the theme that has been loaded.
is_material_video_memory:BOOLEAN
-- Status that indicate that material must be loaded in video memory
is_material_double_buffer:BOOLEAN
-- Status that indicate that the game must use double buffering
is_ghost_show:BOOLEAN
-- Status that indicate that a theme has tetromino ghosts.
is_font_cpf:BOOLEAN
-- Status that indicate that a theme has a font.
custom_control_enable:BOOLEAN
-- Status that indicate that a custon control has been set.
custom_control_ctrl:CUSTOM_CONTROL_CONTROLLER
-- If `custom_control_enable', the control controller that has been loaded.
is_sound_thread:BOOLEAN
-- Status that indicate that sound must be used in a multi-threaded context.
feature -- Error handelling
has_error:BOOLEAN
-- Status that indicate that there was an error in `Current'.
end