Class TScoreList
Unit
Declaration
type TScoreList<T:TScore,constructor> = class(TObjectList<T>)
Description
Generic list of scores registered for a game (use TScoreList if you don't need the genericity)
Hierarchy
- TObject
- TList
- TObjectList
- TScoreList
Overview
Methods
![]() |
constructor Create(EditorName, GameName: string; ScoreFileName: string = 'score.dat'); overload; virtual; |
![]() |
procedure Save; |
![]() |
procedure SaveToFile(AFileName: string); |
![]() |
procedure Load; |
![]() |
procedure LoadFromFile(AFileName: string); |
![]() |
function GetScoreFileName: string; |
![]() |
function Add(APseudo: string; APoints: cardinal; ASaveList: boolean = true) : boolean; overload; |
![]() |
function Add(APseudo: string; APoints: cardinal; ALevel: cardinal; ASaveList: boolean = true): boolean; overload; |
![]() |
function GetOldScoreFileName(EditorName: string = ''; GameName: string = ''): string; |
![]() |
procedure SortByPseudoAsc; |
![]() |
procedure SortByPseudoDesc; |
![]() |
procedure SortByPointsAsc(WithLevel: boolean = true); |
![]() |
procedure SortByPointsDesc(WithLevel: boolean = true); |
Description
Methods
![]() |
constructor Create(EditorName, GameName: string; ScoreFileName: string = 'score.dat'); overload; virtual; |
Scores list constructor |
![]() |
procedure Save; |
Save the list of scores in the default file (GetScoreFileName) |
![]() |
procedure SaveToFile(AFileName: string); |
Save the list of scores in AFileName (and create the path if needed and possible) |
![]() |
procedure Load; |
Load the list of scores from the default file (GetScoreFileName) |
![]() |
procedure LoadFromFile(AFileName: string); |
Load the list of scores from FileName (if it exists) |
![]() |
function GetScoreFileName: string; |
Return default file name for the file list storrage |
![]() |
function Add(APseudo: string; APoints: cardinal; ASaveList: boolean = true) : boolean; overload; |
Add a new score to the list |
![]() |
function Add(APseudo: string; APoints: cardinal; ALevel: cardinal; ASaveList: boolean = true): boolean; overload; |
Add a new score to the list |
![]() |
function GetOldScoreFileName(EditorName: string = ''; GameName: string = ''): string; |
Return old default file name (from u_scores.pas) for compatibility reasons |
![]() |
procedure SortByPseudoAsc; |
Sort the scores list by pseudo in alphabetical order (and level+score if same pseudo is present more than once time) |
![]() |
procedure SortByPseudoDesc; |
Sort the scores list by pseudo in inverse alphabetical order (and level+score if same pseudo is present more than once time) |
![]() |
procedure SortByPointsAsc(WithLevel: boolean = true); |
Sort the scores list by level / points / pseudo (bottom from top) |
![]() |
procedure SortByPointsDesc(WithLevel: boolean = true); |
Sort the scores list by level / points / pseudo (top from bottom) |
Generated by PasDoc 0.16.0.