Exemplo n.º 1
0
        /// <summary>
        /// Loads the content.
        /// </summary>
        private void LoadContent()
        {
            if (String.IsNullOrEmpty(ScriptDir) || !Directory.Exists(ScriptDir))
            {
                throw new ArgumentNullException("Game path is null");
            }
            List <string> files = base.GetCampaignFiles(ScriptDir);

            foreach (var item in files)
            {
                if (File.Exists(item))
                {
                    using (StreamReader sr = File.OpenText(item))
                    {
                        List <string> temp = new List <string>();
                        while (sr.Peek() != -1)
                        {
                            temp.Add(sr.ReadLine());
                        }
                        GameContent.Add(item, temp);
                    }
                }
                else
                {
                    throw new FileNotFoundException("Specified file doesn't exist.");
                }
            }
        }