Class T3DResourceList

Unit

Declaration

type T3DResourceList = class(specialize TObjectList<T3DResource>)

Description

Hierarchy

  • TObjectList
  • T3DResourceList

Overview

Methods

Public function FindName(const AName: string; const NilWhenNotFound: boolean = false): T3DResource;
Public procedure LoadFromFiles(const Path: string; const Reload: boolean = false);
Public procedure LoadFromFiles(const Reload: boolean = false);
Public procedure AddFromFile(const URL: string; const Reload: boolean = false);
Public procedure LoadResources(ParentElement: TDOMElement);
Public procedure Prepare(const Params: TPrepareParams; const ResourcesName: string = 'resources');
Public procedure Release;

Description

Methods

Public function FindName(const AName: string; const NilWhenNotFound: boolean = false): T3DResource;

Find resource with given T3DResource.Name.

Exceptions raised
Exception
if not found and NilWhenNotFound = false.
Public procedure LoadFromFiles(const Path: string; const Reload: boolean = false);

Load all resources (creatures and items) information from resource.xml files found in given Path. Overloaded version without Path just scans the whole castle-data:/ directory.

Note that on Android, searching the Android asset filesystem recursively is not possible (this is a fault of Android NDK API...). So instead of this method, you should use AddFromFile repeatedly to explicitly list all resource.xml locations.

Parameters
Reload
If Reload, then we will not clear the initial list contents. Instead, resource.xml files found that refer to the existing T3DResource.Name will cause T3DResource.LoadFromFile call on an existing resource. Using Reload is a nice debug feature, if you want to reload configuration from resource.xml files (and eventually add new resources in new resource.xml files), but you don't want to recreate existing resource instances.
Public procedure LoadFromFiles(const Reload: boolean = false);
 
Public procedure AddFromFile(const URL: string; const Reload: boolean = false);

Load a single resource from resource.xml file.

Parameters
Reload
If True, and the loaded resource will have a name matching existing T3DResource.Name, we will replace the current resource. Otherwise, we'll make an exception.
Public procedure LoadResources(ParentElement: TDOMElement);

Reads <prepare_resources> XML element. <prepare_resources> element is an optional child of given ParentElement. Sets current list value with all mentioned required resources (subset of Resources).

Public procedure Prepare(const Params: TPrepareParams; const ResourcesName: string = 'resources');

Prepare / release all resources on list.

Public procedure Release;
 

Generated by PasDoc 0.15.0.