Skip to content
Chixpy edited this page Feb 3, 2024 · 1 revision

Warning

Esta ayuda es para la versión 0.7. Está obsoleta e incompleta.

Clase cGameManager en los scripts.

cGameManager = class
  private
  ...
  protected
  ...
  public
    property SystemsFile: UTF8String;
    property EmulatorsFile: UTF8String;
    property GameDataExt: UTF8String;
    property GameGroupExt: UTF8String;

    // FIXME 1: A ver como la puedo hacer protejida :|
    // Por ahora es necesario para saber si debo liberar los objetos o no
    //   cuando se cambia de listado de grupos
    property GroupList: TFPObjectList read FGroupList;

    property System: cSystem read;
    property SelectedEmulator: UTF8String;

    property TempFolder: UTF8String;
    property TempFile: UTF8String;
    property CRCMaxSize: cardinal;

    property CompressedExt: TStringList read;

    function GameAtPos(const aIndex: integer): cGame;
    function Game(aGameKey: UTF8String): cGame;
    function GameCount: longint;

    function GroupAtPos(const aIndex: integer): cGameGroup;
    function Group(aGroupKey: UTF8String): cGameGroup;
    function GroupCount: longint;

    procedure SaveSystem;
    procedure ChangeSystem(const SystemName: UTF8String);

    procedure UpdateGameList;
    procedure SoftUpdateGameList;
    procedure UpdateGroupList;

    function AddFile(Folder: UTF8String; Info: TSearchRec): boolean;
    function AddGame(const aFolder: UTF8String; const aFileName: UTF8String;
      const aKey: UTF8String): cGame;
    function AddGroup(aGameGroupID: UTF8String): cGameGroup;


    procedure SaveSystemGameList;
    procedure LoadSystemGameList;
    procedure ExportGameData(const aFileName: UTF8String;
      const UseCRC: boolean; const ExportMode: boolean);
    procedure ExportGameDataIni(const aIniFile: TCustomIniFile;
      const UseCRC: boolean; const ExportMode: boolean);
    procedure ImportGameData(const aFileName: UTF8String);
    procedure ImportGameDataIni(const aIniFile: TCustomIniFile);

    function FindGroupMediaFile(aFolder: UTF8String; aGameGroup: cGameGroup;
      Extensions: TStringList; MultiFile: boolean;
      SearchInZip: boolean): UTF8String;
    function FindGameMediaFile(aFolder: UTF8String; aGame: cGame;
      Extensions: TStringList; MultiFile: boolean;
      SearchInZip: boolean): UTF8String;
    function FindMediaFile(aFolder: UTF8String; aFileName: UTF8String;
      Extensions: TStringList; MultiFile: boolean;
      SearchInZip: boolean): UTF8String;

    function DecompressFile(CompressedFile, aFile, aFolder: UTF8String): UTF8String;
    function Execute(aGame: cGame): longword;
    function ExecEmulator(EmulatorID, RomFile: UTF8String): longword;
    
    constructor Create(const aSystemsFile: UTF8String;
      const aTempFolder: UTF8String; const aTempFile: UTF8String);
    destructor Destroy; override;
  end;

Propiedaddes

Métodos

Constructor

constructor Create(const aSystemsFile: UTF8String; const aTempFolder: UTF8String; const aTempFile: UTF8String);

La verdad no debería necesitar crear otro gestor de juegos.

Destructor

destructor Destroy; override;

Si no deberías necesitar crear otro gestor de juegos... menos aún destruir el gestor ya existente (en la variable GameManager).

Clone this wiki locally