﻿// Decompiled with JetBrains decompiler
// Type: Wb.Lpw.Game.Common.DataLoading
// Assembly: Wb.Lpw.Game.Common, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: 3C4BDCBA-73F8-4BAA-AC19-A98EC2D71189
// Assembly location: C:\Users\CGA Computer\Desktop\LEGO Universe Stuff\LOCO Server\Unity Web Player Extractor\Saved Files\LOCO Server.unity3d_unpacked\Wb.Lpw.Game.Common.dll

using System;

namespace Wb.Lpw.Game.Common
{
  public class DataLoading
  {
    private DataLoading.ILoader _loader;

    public static DataLoading Instance { get; private set; }

    private DataLoading(DataLoading.ILoader loader)
    {
      this._loader = loader;
    }

    public static DataLoading Create(DataLoading.ILoader loader)
    {
      return DataLoading.Instance = new DataLoading(loader);
    }

    public void LoadText(string dataPath, Action<string> onLoaded, Action<string> onError)
    {
      this._loader.LoadText(dataPath, onLoaded, onError);
    }

    public void LoadBinary(string dataPath, Action<byte[]> onLoaded, Action<string> onError)
    {
      this._loader.LoadBinary(dataPath, onLoaded, onError);
    }

    public interface ILoader
    {
      void LoadText(string dataPath, Action<string> onLoaded, Action<string> onError);

      void LoadBinary(string dataPath, Action<byte[]> onLoaded, Action<string> onError);
    }
  }
}
