HOCO Unity SDK 0.0.15-Alpha
A Web3 SDK provided by HoneyComb
Loading...
Searching...
No Matches
CloudAPI< T >

The Core Logic for interacting with the MongoDb Cloud Database. More...

Static Public Member Functions

static async UniTask< T > Get (string filterProperty, string filterValue, string storageKey="NULL")
 This Method can only return a Live Data Instance type from the database. See LiveCloudData and inherit from it to make your own.
 
static async UniTask< T[]> GetAll (string storageKey)
 
static async UniTask< bool > Update< TInput > (TInput instanceData, string instanceId, string storageKey="NULL")
 
static async UniTask< T > Update (LiveCloudData modifiedInstance, string storageKey="NULL")
 
static async UniTask< bool > Create (T newData, string storageKey="NULL")
 Things to know to use this function: Make sure the Data fed in is a Root class of the data that is to be added to a LiveCloudData. For example, to send PlayerData as used in LivePlayerData.PlayerData, You must only send the given PlayerData through this function. To try and be even more clear. This function will create the LiveCloudData version of PlayerData when you send it through this function, the result is what LivePlayerData is.
 
static async UniTask< bool > Delete (LiveCloudData existingInstance, string storageKey="NULL")
 

Detailed Description

The Core Logic for interacting with the MongoDb Cloud Database.

Template Parameters
TAny type of Serializable Data Class
Type Constraints
T :new() 

Member Function Documentation

◆ Get()

static async UniTask< T > Get ( string filterProperty,
string filterValue,
string storageKey = "NULL" )
inlinestatic

This Method can only return a Live Data Instance type from the database. See LiveCloudData and inherit from it to make your own.

Parameters
filterPropertyThe relative Property to the returned type to filter by, like 'PlayerData.PlayerAddress' if returning LivePlayerData
filterValueThe relative Property Value to filter by, if lookine for 'PlayerData.PlayerAddress' then you feed in a PlayerAddress string as the Value to return the LivePlayerData Instance containing that Address.
storageKeyThe Data store to search in.
Returns
The existing Data on the Database or a new Instance with Null/Empty strings.

Referenced by LivePlayerData.GetByAddress(), and LivePlayerData.GetOrCreateByAddress().

◆ GetAll()

static async UniTask< T[]> GetAll ( string storageKey)
inlinestatic

◆ Update< TInput >()

static async UniTask< bool > Update< TInput > ( TInput instanceData,
string instanceId,
string storageKey = "NULL" )
inlinestatic
Type Constraints
TInput :class 
TInput :new() 

◆ Update()

static async UniTask< T > Update ( LiveCloudData modifiedInstance,
string storageKey = "NULL" )
inlinestatic

References LiveCloudData.Id.

◆ Create()

static async UniTask< bool > Create ( T newData,
string storageKey = "NULL" )
inlinestatic

Things to know to use this function: Make sure the Data fed in is a Root class of the data that is to be added to a LiveCloudData. For example, to send PlayerData as used in LivePlayerData.PlayerData, You must only send the given PlayerData through this function. To try and be even more clear. This function will create the LiveCloudData version of PlayerData when you send it through this function, the result is what LivePlayerData is.

Parameters
newDataThis is the Raw Datatype that will be converted int o LiveCloudData
storageKeyThis is The CollectionName or Table to create this data on the mongo database
Returns
True if was a success

◆ Delete()

static async UniTask< bool > Delete ( LiveCloudData existingInstance,
string storageKey = "NULL" )
inlinestatic