indexing description: "[ A highscore entry consists of a name, a score and possibly other keys, which are accessible through a hash table. ]" date: "$Date$" revision: "$Revision$" class EM_HIGHSCORE_ENTRY Inherit DS_HASH_TABLE[STRING, STRING] create make_default, make feature -- Access score: INTEGER -- user's score name: STRING -- user's name feature -- Element change set_score (a_score: like score) is -- Set `score' to `a_score'. do score := a_score ensure score_assigned: score = a_score end set_name (a_name: like name) is -- Set `name' to `a_name'. do name := a_name ensure name_assigned: name = a_name end feature -- Compare less_than (other: like Current; a_key: STRING): BOOLEAN is -- Is this entry less than the other? (when sorted with 'a_key') -- Sort integers non-alphanumerically require other /= void has (a_key) other.has (a_key) do if item (a_key).is_integer and other.item(a_key).is_integer then Result := item(a_key).to_integer < other.item (a_key).to_integer else Result := item (a_key) < other.item (a_key) end end end