9 score_table
: DICTIONARY
[SCORE
, STRING]
13 load(filename
: STRING) is
15 !!tfr
.connect_to(filename
)
16 if tfr
.is_connected
then
31 until tfr
.end_of_input
33 !!level
.copy(tfr
.last_string
)
35 !!n
.copy(tfr
.last_string
)
37 i
:= tfr
.last_string
.to_integer
39 j
:= tfr
.last_string
.to_integer
41 score_table
.put(sc
, level
)
46 into_preset_list(l
: LINKED_LIST
[PRESET
]) is
48 l
.do_all(agent export_score(?
))
51 export_score(p
: PRESET
) is
53 if score_table
.has(p
.name
) then
54 p
.put_hiscore(score_table
.at(p
.name
))
58 from_preset_list(l
: LINKED_LIST
[PRESET
]) is
60 l
.do_all(agent import_score(?
))
63 import_score(p
: PRESET
) is
65 if p
.hiscore
/= Void
then
66 score_table
.put(p
.hiscore
, p
.name
)
72 save(filename
: STRING) is
74 !!tfw
.connect_to(filename
)
75 score_table
.do_all(agent write_score(?
, ?
))
79 write_score(sc
: SCORE
; level
: STRING) is
81 tfw
.put_string(level
+ " " + sc
.name
+ " ")
82 tfw
.put_string(sc
.score
.to_string
+ " " + sc
.time
.to_string
+ "%N")