Class T3DResourceList
Unit
CastleResources
Declaration
type T3DResourceList = class(specialize TFPGObjectList<T3DResource>)
Description
Hierarchy
- TFPGObjectList
- T3DResourceList
Overview
Methods
Description
Methods
 |
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.
|
 |
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 ApplicationData 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.
|
 |
procedure LoadFromFiles(const Reload: boolean = false); |
|
 |
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.
|
 |
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).
|
 |
procedure Release; |
|
Generated by PasDoc 0.13.0 on 2014-10-26 05:15:14
|