Skip to main content

StorageService API

The StorageService class is responsible for managing storage services across the lifecycle of the game.

Static API

MethodParametersReturnsDescription
SetCurrentSlot
  • string: slot name
  • bool: update storage instances. By default true
Changes the current storage slot. If updateStorageInstances is set to true all initialized storage instances will get its slot updated.
GetCurrentSlotstringGets the current storage slot.
ClearServicesRemoves all initialized services from memory (making them unavailable).
AddService
  • string: service name (unique).
  • StorageService: storage service instance.
Adds a StorageService instance to the initialized services (makes it available).
RemoveService
  • string: service name.
Removes a service from the available services by its unique name.
GetService
  • string: service name.
StorageServiceGiven a storage service name it returns its corresponding instance form initialized services.
GetServicesStorageService[]Returns all initialized storage services as an array.
GetServiceNamesstring[]Returns all initialized storage service names as an array.

Static events API

EventParametersReturnsDescription
onSlotChangedIt gets invoken whenever the currentSlot gets updated.