2021-07-23 16:01:18 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								<?xml version="1.0" encoding="UTF-8" ?>  
						 
					
						
							
								
									
										
										
										
											2022-02-14 14:18:53 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								<class  name= "ResourceUID"  inherits= "Object"  version= "4.0"  xmlns:xsi= "http://www.w3.org/2001/XMLSchema-instance"  xsi:noNamespaceSchemaLocation= "../class.xsd" >  
						 
					
						
							
								
									
										
										
										
											2021-07-23 16:01:18 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
									<brief_description > 
							 
						 
					
						
							
								
									
										
										
										
											2022-08-03 19:59:11 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										Singleton for managing a cache of resource UIDs within a project.
							 
						 
					
						
							
								
									
										
										
										
											2021-07-23 16:01:18 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
									</brief_description> 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									<description > 
							 
						 
					
						
							
								
									
										
										
										
											2022-08-03 19:59:11 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										Resources can not only be referenced using their resource paths [code]res://[/code], but alternatively through a unique identifier specified via [code]uid://[/code].
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										Using UIDs allows for the engine to keep references between resources intact, even if the files get renamed or moved.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										This singleton is responsible for keeping track of all registered resource UIDs of a project, generating new UIDs and converting between the string and integer representation.
							 
						 
					
						
							
								
									
										
										
										
											2021-07-23 16:01:18 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
									</description> 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									<tutorials > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									</tutorials> 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									<methods > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										<method  name= "add_id" > 
							 
						 
					
						
							
								
									
										
										
										
											2021-07-30 15:28:05 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											<return  type= "void"  /> 
							 
						 
					
						
							
								
									
										
										
										
											2022-08-06 21:11:48 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											<param  index= "0"  name= "id"  type= "int"  /> 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											<param  index= "1"  name= "path"  type= "String"  /> 
							 
						 
					
						
							
								
									
										
										
										
											2021-07-23 16:01:18 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
											<description > 
							 
						 
					
						
							
								
									
										
										
										
											2022-08-03 19:59:11 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												Adds a new UID value which is mapped to the given resource path.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												Fails with an error if the UID already exists, so be sure to check [method has_id] beforehand, or use [method set_id] instead.
							 
						 
					
						
							
								
									
										
										
										
											2021-07-23 16:01:18 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
											</description> 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										</method> 
							 
						 
					
						
							
								
									
										
										
										
											2022-02-07 18:42:46 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										<method  name= "create_id" > 
							 
						 
					
						
							
								
									
										
										
										
											2021-07-30 15:28:05 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											<return  type= "int"  /> 
							 
						 
					
						
							
								
									
										
										
										
											2021-07-23 16:01:18 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
											<description > 
							 
						 
					
						
							
								
									
										
										
										
											2022-08-03 19:59:11 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												Generates a random resource UID which is guaranteed to be unique within the list of currently loaded UIDs.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												In order for this UID to be registered, you must call [method add_id] or [method set_id].
							 
						 
					
						
							
								
									
										
										
										
											2021-07-23 16:01:18 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
											</description> 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										</method> 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										<method  name= "get_id_path"  qualifiers= "const" > 
							 
						 
					
						
							
								
									
										
										
										
											2021-07-30 15:28:05 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											<return  type= "String"  /> 
							 
						 
					
						
							
								
									
										
										
										
											2022-08-06 21:11:48 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											<param  index= "0"  name= "id"  type= "int"  /> 
							 
						 
					
						
							
								
									
										
										
										
											2021-07-23 16:01:18 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
											<description > 
							 
						 
					
						
							
								
									
										
										
										
											2022-08-03 19:59:11 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												Returns the path that the given UID value refers to.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												Fails with an error if the UID does not exist, so be sure to check [method has_id] beforehand.
							 
						 
					
						
							
								
									
										
										
										
											2021-07-23 16:01:18 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
											</description> 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										</method> 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										<method  name= "has_id"  qualifiers= "const" > 
							 
						 
					
						
							
								
									
										
										
										
											2021-07-30 15:28:05 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											<return  type= "bool"  /> 
							 
						 
					
						
							
								
									
										
										
										
											2022-08-06 21:11:48 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											<param  index= "0"  name= "id"  type= "int"  /> 
							 
						 
					
						
							
								
									
										
										
										
											2021-07-23 16:01:18 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
											<description > 
							 
						 
					
						
							
								
									
										
										
										
											2022-08-03 19:59:11 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												Returns whether the given UID value is known to the cache.
							 
						 
					
						
							
								
									
										
										
										
											2021-07-23 16:01:18 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
											</description> 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										</method> 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										<method  name= "id_to_text"  qualifiers= "const" > 
							 
						 
					
						
							
								
									
										
										
										
											2021-07-30 15:28:05 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											<return  type= "String"  /> 
							 
						 
					
						
							
								
									
										
										
										
											2022-08-06 21:11:48 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											<param  index= "0"  name= "id"  type= "int"  /> 
							 
						 
					
						
							
								
									
										
										
										
											2021-07-23 16:01:18 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
											<description > 
							 
						 
					
						
							
								
									
										
										
										
											2022-08-03 19:59:11 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												Converts the given UID to a [code]uid://[/code] string value.
							 
						 
					
						
							
								
									
										
										
										
											2021-07-23 16:01:18 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
											</description> 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										</method> 
							 
						 
					
						
							
								
									
										
										
										
											2021-07-25 11:54:48 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										<method  name= "remove_id" > 
							 
						 
					
						
							
								
									
										
										
										
											2021-07-30 15:28:05 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											<return  type= "void"  /> 
							 
						 
					
						
							
								
									
										
										
										
											2022-08-06 21:11:48 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											<param  index= "0"  name= "id"  type= "int"  /> 
							 
						 
					
						
							
								
									
										
										
										
											2021-07-25 11:54:48 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											<description > 
							 
						 
					
						
							
								
									
										
										
										
											2022-08-03 19:59:11 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												Removes a loaded UID value from the cache.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												Fails with an error if the UID does not exist, so be sure to check [method has_id] beforehand.
							 
						 
					
						
							
								
									
										
										
										
											2021-07-25 11:54:48 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											</description> 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										</method> 
							 
						 
					
						
							
								
									
										
										
										
											2021-07-23 16:01:18 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
										<method  name= "set_id" > 
							 
						 
					
						
							
								
									
										
										
										
											2021-07-30 15:28:05 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											<return  type= "void"  /> 
							 
						 
					
						
							
								
									
										
										
										
											2022-08-06 21:11:48 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											<param  index= "0"  name= "id"  type= "int"  /> 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											<param  index= "1"  name= "path"  type= "String"  /> 
							 
						 
					
						
							
								
									
										
										
										
											2021-07-23 16:01:18 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
											<description > 
							 
						 
					
						
							
								
									
										
										
										
											2022-08-03 19:59:11 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												Updates the resource path of an existing UID.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												Fails with an error if the UID does not exist, so be sure to check [method has_id] beforehand, or use [method add_id] instead.
							 
						 
					
						
							
								
									
										
										
										
											2021-07-23 16:01:18 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
											</description> 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										</method> 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										<method  name= "text_to_id"  qualifiers= "const" > 
							 
						 
					
						
							
								
									
										
										
										
											2021-07-30 15:28:05 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											<return  type= "int"  /> 
							 
						 
					
						
							
								
									
										
										
										
											2022-08-06 21:11:48 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											<param  index= "0"  name= "text_id"  type= "String"  /> 
							 
						 
					
						
							
								
									
										
										
										
											2021-07-23 16:01:18 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
											<description > 
							 
						 
					
						
							
								
									
										
										
										
											2022-08-03 19:59:11 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												Extracts the UID value from the given [code]uid://[/code] string.
							 
						 
					
						
							
								
									
										
										
										
											2021-07-23 16:01:18 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
											</description> 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										</method> 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									</methods> 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									<constants > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										<constant  name= "INVALID_ID"  value= "-1" > 
							 
						 
					
						
							
								
									
										
										
										
											2022-08-03 19:59:11 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											The value to use for an invalid UID, for example if the resource could not be loaded.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											Its text representation is [code]uid://< invalid> [/code].
							 
						 
					
						
							
								
									
										
										
										
											2021-07-23 16:01:18 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
										</constant> 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									</constants> 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								</class>