using UnityEngine;
using GadgetCore.API;

namespace WorldPlatforms
{
  [Gadget("WorldPlatforms")]
  public class WorldPlatforms : Gadget<WorldPlatforms>
  {
    public const string MOD_VERSION = "1.0"; // Set this to the version of your mod.
    public const string CONFIG_VERSION = "1.0"; // Increment this whenever you change your mod's config file.

    protected override void LoadConfig()
    {
      Config.Load();

      string fileVersion = Config.ReadString("ConfigVersion", CONFIG_VERSION, comments: "The Config Version (not to be confused with mod version)");

      if (fileVersion != CONFIG_VERSION)
      {
        Config.Reset();
        Config.WriteString("ConfigVersion", CONFIG_VERSION, comments: "The Config Version (not to be confused with mod version)");
      }

      Config.Save();
    }

    public override string GetModDescription()
    {
      return "A mod that adds some more WorldPlatforms.";
    }

    protected override void Initialize()
    {
      Logger.Log("More WorldPlatforms v" + Info.Mod.Version);
      Core.logger = Logger;
    }
  }
}
