Resource class: Difference between revisions
From Catglobe Wiki
More actions
Created page with "{{CGscriptClass_Template|Name=<nowiki>Resource</nowiki>|Description=<nowiki>Represents a resource.</nowiki>|InheritsFrom=Array|Methods={{CGscriptMethods_Template|ReturnType=bool|Name=<nowiki>Delete</nowiki>|Description=<nowiki>Deletes this resource</nowiki>}} {{CGscriptMethods_Template|ReturnType=string|Name=<nowiki>ToString</nowiki>|Description=<nowiki>The string representation of the object.</nowiki>}} {{CGscriptMethods_Template|ReturnType=object|Name=<nowiki>this[] {..." Â |
No edit summary  |
||
| Line 1: | Line 1: | ||
{{CGscriptClass_Template|Name=<nowiki>Resource</nowiki>|Description=<nowiki>Represents a resource.</nowiki>|InheritsFrom=Array|Methods={{CGscriptMethods_Template|ReturnType=bool|Name=<nowiki>Delete</nowiki>|Description=<nowiki>Deletes this resource</nowiki>}} | {{CGscriptClass_Template | ||
|Name=<nowiki>Resource</nowiki> | |||
|Description=<nowiki>Represents a resource.</nowiki> | |||
|InheritsFrom=Array|Methods= | |||
{{CGscriptMethods_Template|ReturnType=bool|Name=<nowiki>Delete</nowiki>|Description=<nowiki>Deletes this resource</nowiki>}} | |||
{{CGscriptMethods_Template|ReturnType=string|Name=<nowiki>ToString</nowiki>|Description=<nowiki>The string representation of the object.</nowiki>}} | {{CGscriptMethods_Template|ReturnType=string|Name=<nowiki>ToString</nowiki>|Description=<nowiki>The string representation of the object.</nowiki>}} | ||
{{CGscriptMethods_Template|ReturnType=object|Name=<nowiki>this[] { get; }</nowiki>|Parameters= | {{CGscriptMethods_Template|ReturnType=object|Name=<nowiki>this[] { get; }</nowiki>|Parameters= | ||
| Line 6: | Line 10: | ||
{{CGscriptMethods_Template|ReturnType=Empty|Name=<nowiki>this[] { get; }</nowiki>|Parameters= | {{CGscriptMethods_Template|ReturnType=Empty|Name=<nowiki>this[] { get; }</nowiki>|Parameters= | ||
{{CGscriptParameters_Template|Type=int|Name=<nowiki>index</nowiki>|Description=<nowiki>Index</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=object|Name=<nowiki>value</nowiki>|Description=<nowiki>Value to set</nowiki>}} | {{CGscriptParameters_Template|Type=int|Name=<nowiki>index</nowiki>|Description=<nowiki>Index</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=object|Name=<nowiki>value</nowiki>|Description=<nowiki>Value to set</nowiki>}} | ||
|Description=<nowiki>Backward-compatible indexer</nowiki>}}|Properties={{CGscriptProperties_Template|ReturnType=number|Name=<nowiki>Average</nowiki>|HasGetter=1|Description=<nowiki>Average of the objects in the Array object. Can only use if all the elements are of type Number</nowiki>}} | |Description=<nowiki>Backward-compatible indexer</nowiki>}} | ||
|Properties= | |||
{{CGscriptProperties_Template|ReturnType=number|Name=<nowiki>Average</nowiki>|HasGetter=1|Description=<nowiki>Average of the objects in the Array object. Can only use if all the elements are of type Number</nowiki>}} | |||
{{CGscriptProperties_Template|ReturnType=number|Name=<nowiki>Max</nowiki>|HasGetter=1|Description=<nowiki>Largest of all the objects in the Array object. Can only use if all the elements are of type Number</nowiki>}} | {{CGscriptProperties_Template|ReturnType=number|Name=<nowiki>Max</nowiki>|HasGetter=1|Description=<nowiki>Largest of all the objects in the Array object. Can only use if all the elements are of type Number</nowiki>}} | ||
{{CGscriptProperties_Template|ReturnType=number|Name=<nowiki>Min</nowiki>|HasGetter=1|Description=<nowiki>Smallest of all the objects in the Array object. Can only use if all the elements are of type Number</nowiki>}} | {{CGscriptProperties_Template|ReturnType=number|Name=<nowiki>Min</nowiki>|HasGetter=1|Description=<nowiki>Smallest of all the objects in the Array object. Can only use if all the elements are of type Number</nowiki>}} | ||
| Line 16: | Line 22: | ||
{{CGscriptProperties_Template|ReturnType=number|Name=<nowiki>Sum</nowiki>|HasGetter=1|Description=<nowiki>Sum of all the objects in the Array object. Can only use if all the elements are of type Number</nowiki>}} | {{CGscriptProperties_Template|ReturnType=number|Name=<nowiki>Sum</nowiki>|HasGetter=1|Description=<nowiki>Sum of all the objects in the Array object. Can only use if all the elements are of type Number</nowiki>}} | ||
{{CGscriptProperties_Template|ReturnType=int|Name=<nowiki>TemplateResourceId</nowiki>|HasGetter=1|Description=<nowiki>Unique id of the resource template (0 if none)</nowiki>}} | {{CGscriptProperties_Template|ReturnType=int|Name=<nowiki>TemplateResourceId</nowiki>|HasGetter=1|Description=<nowiki>Unique id of the resource template (0 if none)</nowiki>}} | ||
{{CGscriptProperties_Template|ReturnType=TypeInformation|Name=<nowiki>TypeInformation</nowiki>|HasGetter=1|Description=<nowiki>Get information about this class.</nowiki>}}|StaticMethods={{CGscriptMethods_Template|ReturnType=bool|Name=<nowiki>Resource_delete</nowiki>|Parameters= | {{CGscriptProperties_Template|ReturnType=TypeInformation|Name=<nowiki>TypeInformation</nowiki>|HasGetter=1|Description=<nowiki>Get information about this class.</nowiki>}} | ||
|StaticMethods= | |||
{{CGscriptMethods_Template|ReturnType=bool|Name=<nowiki>Resource_delete</nowiki>|Parameters= | |||
{{CGscriptParameters_Template|Type=int|Name=<nowiki>resource unique id</nowiki>|Description=<nowiki>Resource unique id</nowiki>}} | {{CGscriptParameters_Template|Type=int|Name=<nowiki>resource unique id</nowiki>|Description=<nowiki>Resource unique id</nowiki>}} | ||
|Description=<nowiki>Deletes a resource</nowiki>}} | |Description=<nowiki>Deletes a resource</nowiki>}} | ||
| Line 36: | Line 44: | ||
{{CGscriptMethods_Template|ReturnType=array|Name=<nowiki>Resource_searchByName</nowiki>|Parameters= | {{CGscriptMethods_Template|ReturnType=array|Name=<nowiki>Resource_searchByName</nowiki>|Parameters= | ||
{{CGscriptParameters_Template|Type=string|Name=<nowiki>searchName</nowiki>|Description=<nowiki>Name pattern to search for</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=int|Name=<nowiki>resourceType</nowiki>|Description=<nowiki>Resource type constant to filter by</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=int|Name=<nowiki>resourceTemplateResourceId</nowiki>|Description=<nowiki>Resource template id (0 for any)</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=int|Name=<nowiki>nameSearchType</nowiki>|Description=<nowiki>Name search type constant (contains, starts-with, etc.)</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=int?|Name=<nowiki>maxCount</nowiki>|Description=<nowiki>Maximum number of results to return</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=int?|Name=<nowiki>parentResourceId</nowiki>|Description=<nowiki>Parent resource id to restrict search under (0 for all)</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=bool?|Name=<nowiki>includeSubChildren</nowiki>|Description=<nowiki>Whether to include all descendants rather than direct children only</nowiki>}} | {{CGscriptParameters_Template|Type=string|Name=<nowiki>searchName</nowiki>|Description=<nowiki>Name pattern to search for</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=int|Name=<nowiki>resourceType</nowiki>|Description=<nowiki>Resource type constant to filter by</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=int|Name=<nowiki>resourceTemplateResourceId</nowiki>|Description=<nowiki>Resource template id (0 for any)</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=int|Name=<nowiki>nameSearchType</nowiki>|Description=<nowiki>Name search type constant (contains, starts-with, etc.)</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=int?|Name=<nowiki>maxCount</nowiki>|Description=<nowiki>Maximum number of results to return</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=int?|Name=<nowiki>parentResourceId</nowiki>|Description=<nowiki>Parent resource id to restrict search under (0 for all)</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=bool?|Name=<nowiki>includeSubChildren</nowiki>|Description=<nowiki>Whether to include all descendants rather than direct children only</nowiki>}} | ||
|Description=<nowiki>Searches for resources matching a name pattern, filtered by type, template, search type, parent resource and sub-children</nowiki>}}}} | |Description=<nowiki>Searches for resources matching a name pattern, filtered by type, template, search type, parent resource and sub-children</nowiki>}} | ||
}} | |||
Latest revision as of 04:14, 24 July 2026
Resource
Represents a resource.
Parent class
Inherits from Array
Methods
Properties
- number Average { get; } - Average of the objects in the Array object. Can only use if all the elements are of type Number
- number Max { get; } - Largest of all the objects in the Array object. Can only use if all the elements are of type Number
- number Min { get; } - Smallest of all the objects in the Array object. Can only use if all the elements are of type Number
- string Name { get; } - Name of the resource
- string ObjectTypeName { get; } - The name of the type of object.
- int ParentResourceId { get; } - Unique id of the parent resource
- int ResourceId { get; } - Resource unique id
- int ResourceType { get; } - Resource type constant
- number Sum { get; } - Sum of all the objects in the Array object. Can only use if all the elements are of type Number
- int TemplateResourceId { get; } - Unique id of the resource template (0 if none)
- TypeInformation TypeInformation { get; } - Get information about this class.
Static Methods
- bool Resource_delete(int resource unique id "Resource unique id") - Deletes a resource
- Resource Resource_getParentResource(int resource unique id "Resource unique id") - Gets the parent resource of a resource
- Dictionary Resource_searchByChildResourceIdAndResourceType(array resource id "Array of child resource IDs to search parents for", int Resource type "Resource type to filter parent resources by") - Returns a dictionary mapping parent resource IDs to arrays of child resources, filtered by the given resource type
- array Resource_searchByName(string searchName "Name pattern to search for", int resourceType "Resource type constant to filter by", int resourceTemplateResourceId "Resource template id (0 for any)", int nameSearchType "Name search type constant (contains, starts-with, etc.)") - Searches for resources matching a name pattern, filtered by type, template and search type
- array Resource_searchByName(string searchName "Name pattern to search for", int resourceType "Resource type constant to filter by", int resourceTemplateResourceId "Resource template id (0 for any)", int nameSearchType "Name search type constant (contains, starts-with, etc.)", int? maxCount "Maximum number of results to return") - Searches for resources matching a name pattern, filtered by type, template and search type, with max count
- array Resource_searchByName(string searchName "Name pattern to search for", int resourceType "Resource type constant to filter by", int resourceTemplateResourceId "Resource template id (0 for any)", int nameSearchType "Name search type constant (contains, starts-with, etc.)", int? maxCount "Maximum number of results to return", int? parentResourceId "Parent resource id to restrict search under (0 for all)") - Searches for resources matching a name pattern, filtered by type, template, search type and parent resource
- array Resource_searchByName(string searchName "Name pattern to search for", int resourceType "Resource type constant to filter by", int resourceTemplateResourceId "Resource template id (0 for any)", int nameSearchType "Name search type constant (contains, starts-with, etc.)", int? maxCount "Maximum number of results to return", int? parentResourceId "Parent resource id to restrict search under (0 for all)", bool? includeSubChildren "Whether to include all descendants rather than direct children only") - Searches for resources matching a name pattern, filtered by type, template, search type, parent resource and sub-children