DataModel
Like what your seeing?
Support us as a GitHub Sponsor and get instant access to all our assets, exclusive tools and assets, escalated support and issue tracking and our gratitude. These articles are made possible by our GitHub Sponsors ... become a sponsor today!
Introduction
An abstract class that can be inherited from in order to create custom serializable data types for use with Steam Remote Storage. The idea is that you create a serializable data type defining the fields you wish to include in the file and can then create an object to represent that file type which has easy access to Steam Remote Storage.
Example
with this done you can now easily create and save or load data as MyCustomData
for example
Events
Data Updated
This event is raised when a new file has been loaded into memory for this model.
Fields and Attributes
extension
What if any extension should be added to the file, defining this allows the system to assume what files belong to what data model e.g. all files whose extensions match this value are assumed to be compatible with this model.
This means you can create a .dat model and a .profile model and trust that the system can identify and load the proper files to the proper models.
Available Files
The collection of all Steam Remote Storage files found to match this model.
Data Type
Gets the base type of the data stored by this model
Data
Stores the current instance of the data in local memory
Methods
Refresh
checks Steam for files that match this model and populates the Available Files collection.
Load Byte Array
loads data from a byte array
Load Json
loads data from a json formatted string
Load File Address
Loads data from a file on Steam Remote Storage
Load File Address Async
Loads data from a file on Steam Remote Storage, the callback will be invoked when the load has completed.
To Byte Array
Converts the current in memory data to a byte[]
To Json
Converts the current in memory data to a json formatted string
Save
Saves the data to Steam Remote Storage with a given name, this will append the extension if defined.
Save Async
Saves the data to Steam Remote Storage with a given name, this will append the extension if defined. The callback will be invoked when the operation is completed.
Last updated