Skip to content

Data Providers

TinyPlay edited this page Aug 5, 2022 · 1 revision

What is Data Providers (Loaders)

Data provider classes used to serialize / deserialize objects from / to files. You can use it to load/save your game models. Data providers in the XDot Framework contains also encrypted feature.

Base types of Data Loaders

You can use one of this loader out-of-the-box:

  • JsonDataLoader - to serialize / deserialize objects using Unity Json Serializer;
  • XmlDataLoader - to serialize / deserialize objects using Xml format;
  • BinaryDataLoader - to serialize / deserialize objects using Binary Formatter;
  • EncryptedDataLoader - to serialize / deserialize objects using Unity Json Serializer and AES encryption;

Data Loader Usage Example:

EncryptedDataLoader<MyModel> dataLoader = new EncryptedDataLoader<MyModel>(path);
MyModel model = dataLoader.LoadData((MyModel)_currentModel);

Your own Data Loader

You can write your own data loader with XDot Framework interfaces.

Basic Data Loader Interface:

namespace XDot.DataLoader
{
    public interface IDataLoader<TData> where TData : class
    {
        void SaveData(TData dataToSave);
        TData LoadData(TData inputObject = null);
    }
}

General Topics:

Development Info

This framework is under MIT license. Developed by Ilya Rastorguev specially for Pixel Incubator.

Contacts

You can ask me about XDot Framework using Telegram @SodaBoom or by email: iliya-sdt@yandex.ru

Clone this wiki locally