High Score

A library for managing high score tables/leaderboards

File:
HighScore.lib
Version:
1.0
Author:
John Master

Contents

Details
Sub routines


Details

This library handles very simple high score lists, containing only names and scored points.


Subroutines

Name
Parameters
Brief description
procedure
HS_Init
maxEntries, standardName$, maxScore
Init high score list.
function
HS_Load
filename$
Load list from file.
function
HS_Save
filename$
Save list.
function
HS_GetName$
index
Get name at specific index, where 0 has the highest score.
function
HS_GetScore
index
Get score at specific index, where 0 has the highest score.
function
HS_GetNames$[]
Return all names.
function
HS_GetScores[]
Return all scores.
function
HS_IsQualified
score
Returns true if score is high enough for an entry.
function
HS_AddEntry
name$, score
Add new entry.
procedure
HS_SetDefaultName
name$
Set default name.


Subroutine documentation

procedure HS_Init ( maxEntries, standardName$, maxScore )

Init a list for a specific number of entries.

Parameter
Mode
Description
maxEntries
In
Max number of entries.
standardName
In
Name for all entries in auto-generated list.
maxScore
In
Max score for entries in auto-generated list.

[ Back ]


function HS_Load ( filename$ )

Load list from file.

Parameter
Mode
Description
filename
In
Name of file.

Return value
True on success.

[ Back ]


function HS_Save ( filename$ )

Save list.

Parameter
Mode
Description
filename
In
Name of file.

Return value
True on success.

[ Back ]


function HS_GetName$ ( index )

Get name at specific index, where 0 has the highest score.

Parameter
Mode
Description
index
In
Index of entry.

Return value
The name.

[ Back ]


function HS_GetScore ( index )

Get score at specific index, where 0 has the highest score.

Parameter
Mode
Description
Index
In
of entry.

Return value
The score.

[ Back ]


function HS_GetNames$[] ( )

Return all names.

Return value
All names.

[ Back ]


function HS_GetScores[] ( )

Return all scores.

Return value
All scores.

[ Back ]


function HS_IsQualified ( score )

Returns true if score is high enough for an entry.

Parameter
Mode
Description
The
In
score.

Return value
Truw if score is high enough.

[ Back ]


function HS_AddEntry ( name$, score )

Add new entry.

Parameter
Mode
Description
name
In
The name.
score
In
The score.

Return value
True on success, false if score is not high enough.

[ Back ]


procedure HS_SetDefaultName ( name$ )

Set default name to be used if player submits an empty string.

Parameter
Mode
Description
name
In
The name.

[ Back ]


Generated with NLDoc 20140630.