47 lines
653 B
ObjectPascal
47 lines
653 B
ObjectPascal
|
unit Game.List;
|
||
|
|
||
|
interface
|
||
|
uses
|
||
|
System.Generics.Collections,
|
||
|
|
||
|
Game.Base;
|
||
|
|
||
|
|
||
|
type
|
||
|
TGameList = class(TList<TCustomGame>)
|
||
|
private
|
||
|
class var SInstance: TGameList;
|
||
|
protected
|
||
|
class procedure Finalize;
|
||
|
public
|
||
|
class function Instance: TGameList;
|
||
|
end;
|
||
|
|
||
|
|
||
|
implementation
|
||
|
uses
|
||
|
System.SysUtils;
|
||
|
|
||
|
|
||
|
{ TGameList }
|
||
|
class procedure TGameList.Finalize;
|
||
|
begin
|
||
|
FreeAndNil(SInstance);
|
||
|
end;
|
||
|
|
||
|
|
||
|
class function TGameList.Instance: TGameList;
|
||
|
begin
|
||
|
if not Assigned(SInstance) then
|
||
|
SInstance := TGameList.Create;
|
||
|
|
||
|
Result := SInstance;
|
||
|
end;
|
||
|
|
||
|
|
||
|
initialization
|
||
|
finalization
|
||
|
TGameList.Finalize;
|
||
|
|
||
|
end.
|