Doloro GDK 22 .1.0 Beta
by Tauri Interactive
Doloro.InvetorySystem.StoragesService Class Reference

Detailed Description

Helper class that provides API for handling Storage instances at runtime. Implements entity component system conception for Storages instances.

Static Public Member Functions

static Storage RentStorageEntity (Guid sourceId)
 Renting a free storage for the StoragesDatabase entry. More...
 
static Storage RentStorageEntity (this StoragesDatabase.StorageContainer source)
 Renting a free storage entity related to the data container. More...
 
static bool IsRentedFor (Guid sourceId)
 Checks is the source already has rented entity. More...
 
static bool IsRentedFor (this StoragesDatabase.StorageContainer source)
 Checks is the source already has rented entity. More...
 
static bool TryGetRented (this StoragesDatabase.StorageContainer source, out Storage instance)
 Tries to find Storage instance rented for certain StoragesDatabase.StorageContainer. More...
 
static bool TryGetRented (Guid sourceId, out Storage instance)
 Tries to find Storage instance rented for certain StoragesDatabase.StorageContainer by its GUID. More...
 
static bool ReleaseRentedEntity (this StoragesDatabase.StorageContainer source)
 Releases rented entity binded to the data source. More...
 
static bool ReleaseRentedEntity (this Storage representation)
 Releases rented entity binded to the data source. More...
 
static bool ReleaseRentedEntity (Guid storageId)
 Releases rented entity binded to the data source. More...
 
static Storage InstantiateStorage (string resoruceBundle, string storageResourceKey)
 Instantiating Storage resource with certain signature to the world. More...
 
static Storage InstantiateStorage (this StoragesDatabase.StorageContainer source)
 Instantiating Storage defined with data container. More...
 
static Storage InstantiateStorage (params Tag[] tags)
 Looking for first detecting Storage resource with defined tags collection. More...
 
static IEnumerator< StorageGetEnumerator ()
 Returns rented Storages enumerator. More...
 

Properties

static GameObject HierarchyCategory [get]
 Game object that holds entire rented storages by default.
 

Events

static Storage.StorageDelegate StorageRented
 Occurs when new storage rented.
 
static Storage.StorageDelegate StorageReleasePreparation
 Occurs before storage will be released.
 

Member Function Documentation

◆ GetEnumerator()

static IEnumerator< Storage > Doloro.InvetorySystem.StoragesService.GetEnumerator ( )
static

Returns rented Storages enumerator.

Returns
Enumerator instance.

◆ InstantiateStorage() [1/3]

static Storage Doloro.InvetorySystem.StoragesService.InstantiateStorage ( params Tag[]  tags)
static

Looking for first detecting Storage resource with defined tags collection.

Parameters
tagsTags that describes storage type.
Returns
In game instance of the storage.
Exceptions
KeyNotFoundExceptionSuitable Storage resource not found.

◆ InstantiateStorage() [2/3]

static Storage Doloro.InvetorySystem.StoragesService.InstantiateStorage ( string  resoruceBundle,
string  storageResourceKey 
)
static

Instantiating Storage resource with certain signature to the world.

Parameters
resoruceBundle
storageResourceKey
Returns
In game instance of the storage.
Exceptions
KeyNotFoundExceptionStorage resource not found by the signature.

◆ InstantiateStorage() [3/3]

static Storage Doloro.InvetorySystem.StoragesService.InstantiateStorage ( this StoragesDatabase.StorageContainer  source)
static

Instantiating Storage defined with data container.

Parameters
sourceSource data container that describes storage state at the save moment.
Returns
In game instance of the storage.
Exceptions
KeyNotFoundExceptionStorage resource not found by the signature.

◆ IsRentedFor() [1/2]

static bool Doloro.InvetorySystem.StoragesService.IsRentedFor ( Guid  sourceId)
static

Checks is the source already has rented entity.

Parameters
sourceIdId of the storage in StoragesDatabase
Returns
Result of check.

◆ IsRentedFor() [2/2]

static bool Doloro.InvetorySystem.StoragesService.IsRentedFor ( this StoragesDatabase.StorageContainer  source)
static

Checks is the source already has rented entity.

Parameters
sourceData container.
Returns
Result of check.

◆ ReleaseRentedEntity() [1/3]

static bool Doloro.InvetorySystem.StoragesService.ReleaseRentedEntity ( Guid  storageId)
static

Releases rented entity binded to the data source.

Parameters
storageIdIf of the storage in database to release.
Returns
true in case if rented entity found. false otherwise.

Use as soon as you no longer need in-game Storage object that represent a source data.

See also
RentStorageEntity(StoragesDatabase.StorageContainer)

◆ ReleaseRentedEntity() [2/3]

static bool Doloro.InvetorySystem.StoragesService.ReleaseRentedEntity ( this Storage  representation)
static

Releases rented entity binded to the data source.

Parameters
representationRented storage instance with a bonded data source.
Returns
true in case if rented entity found. false otherwise.
Exceptions
ArgumentNullExceptionrepresentation or its source property is null.

Use as soon as you no longer need in-game Storage object that represent a source data.

See also
RentStorageEntity(StoragesDatabase.StorageContainer)

◆ ReleaseRentedEntity() [3/3]

static bool Doloro.InvetorySystem.StoragesService.ReleaseRentedEntity ( this StoragesDatabase.StorageContainer  source)
static

Releases rented entity binded to the data source.

Parameters
sourceData source binded to the storage entity.
Returns
true in case if rented entity found. false otherwise.
Exceptions
ArgumentNullExceptionsource is null.

Use as soon as you no longer need in-game Storage object that represent a source data.

See also
RentStorageEntity(StoragesDatabase.StorageContainer)

◆ RentStorageEntity() [1/2]

static Storage Doloro.InvetorySystem.StoragesService.RentStorageEntity ( Guid  sourceId)
static

Renting a free storage for the StoragesDatabase entry.

Parameters
sourceIdId of the storage in database.
Returns
Runtime storage entity.

◆ RentStorageEntity() [2/2]

static Storage Doloro.InvetorySystem.StoragesService.RentStorageEntity ( this StoragesDatabase.StorageContainer  source)
static

Renting a free storage entity related to the data container.

Parameters
source
Returns

Use it instead InstantiateStorage(StoragesDatabase.StorageContainer) to following the ECS concept.

The service automatically create new instance in case current solo-one already has been rented. In that way you prevent creating unnecessary in-game entities related to back-end data, that allow you to handle any count of Storages at the same scene without affecting performance.

Exceptions
KeyNotFoundExceptionStorage resource defied with the source not found among loaded.
ArgumentNullExceptionsource is null.

◆ TryGetRented() [1/2]

static bool Doloro.InvetorySystem.StoragesService.TryGetRented ( Guid  sourceId,
out Storage  instance 
)
static

Tries to find Storage instance rented for certain StoragesDatabase.StorageContainer by its GUID.

Parameters
sourceId of source database entry to search.
instanceInstance in case if found among rented.
Returns
Result of search among rented. true if found, false otherwise.

Unsafe method. Such an instance could be released from renting or change its content by an agent that rented it at first.

best practice to rent new instance.

◆ TryGetRented() [2/2]

static bool Doloro.InvetorySystem.StoragesService.TryGetRented ( this StoragesDatabase.StorageContainer  source,
out Storage  instance 
)
static

Tries to find Storage instance rented for certain StoragesDatabase.StorageContainer.

Parameters
sourceSource database entry to search.
instanceInstance in case if found among rented.
Returns
Result of search among rented. true if found, false otherwise.

Unsafe method. Such an instance could be released from renting or change its content by an agent that rented it at first.

best practice to rent new instance.


The documentation for this class was generated from the following files: