-
Notifications
You must be signed in to change notification settings - Fork 16
Infrastructure
mod.io UNITY contains four core functional classes each of which provides a static interface to the various features the plugin offers.
-
APIClient
provides a native wrapper for all the endpoints that the mod.io API serves. These functions work on a callback system, requiring a success-handling and an error-handling, and affect no global state. -
DownloadClient
provides an interface for downloading images and mod binaries easily. It makes calls to the API to ensure that the latest versions of assets are being downloaded. -
CacheClient
provides an ease-of-use interface for accessing and storing both data objects and assets. It is recommended that developers cache data to save bandwidth and to allow functionality while the app is offline. -
ModManager
provides an interface for common plugin tasks such as checking if a requested asset is cached, and downloading and storing the requested asset if it doesn't yet exist on disk. For the most part, it wraps and combines the functionality provided byAPIClient
andCacheClient
to provide a convenient way of making API requests for data that can be cached.
The Data Objects folder contains the bulk of the objects that the plugin receives from the API, while Editable Objects is primarily for objects that need to be sent to the API endpoints. Of note, the Editable Objects are an intermiediary format comprising of EditableField objects, that are easily converted into a dictionary-like format that can be sent in a HTTP request. The API folder contains data structures that are only used in conjuction with calls made through the APIClient interface. Image Locators are data objects that contains the various URLs for the different resolutions of any given image, while Requests are the objects that are generated when the various DownloadClient functions are used for downloading a remote asset.