using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Windows.Forms;

namespace Global
{
    public static class Globals
    {
        public static string Response = "no";
        public static string UserName = "";
        //Map Specific
        /// <summary>
        /// List of every Tag in the map with it's default extension
        /// </summary>
        public static List<string> Tags = new List<string>();
        /// <summary>
        /// List of every StringID in the map
        /// </summary>
        public static List<string> Strings = new List<string>();
        /// <summary>
        /// List of every Tag Identifier In the map
        /// </summary>
        public static List<int> Idents = new List<int>();

        //Current Tag
        /// <summary>
        /// List of every Tag Ident in the Current Tag
        /// </summary>
        public static List<int> TagIdents = new List<int>();
        /// <summary>
        /// List of every Tag Reference in the current Tag.
        /// </summary>
        public static List<string> TagReferences = new List<string>();
        /// <summary>
        /// List of every String ID in the current Tag
        /// </summary>
        public static List<int> TagStrings = new List<int>();
        /// <summary>
        /// List of every String ID in the current Tag
        /// </summary>
        public static List<string> TagStringIds = new List<string>();

        public static object Plugin = null;
        public static Project p = null;

        public static string RecentProj = "";

        public static int GetTagIndex(string Path)
        {
            if (Tags.Contains(Path))
            {
                TagIdents.Add(Idents[Tags.IndexOf(Path)]);
                return TagIdents.Count - 1;
            }
            return -1;
        }

        public static int GetTagIndex(int Ident)
        {
            if (Idents.Contains(Ident))
            {
                TagIdents.Add(Idents[Idents.IndexOf(Ident)]);
                return TagIdents.Count - 1;
            }
            return -1;
        }

        public static int GetStringIndex(string Name)
        {
            if (Strings.Contains(Name))
            {
                TagStrings.Add(Strings.IndexOf(Name));
                return TagStrings.Count - 1;
            }
            return 0;
        }
    }
}
