//Dictionary<string, string> cmdList_generated { get; set; }
        //Dictionary<string, string> objList_generated { get; set; }

        //Constructor
        public DataRead_WordLists(string name)
        {
            cmds             = new Dictionary <string, string>();
            cmdList_single   = new Dictionary <string, string>();
            cmdList_constant = new Dictionary <string, string>();
            //cmdList_generated = new Dictionary<string, string>();
            //cmdList_single_LoadList = new Dictionary<string, string>();
            //objList_generated = new Dictionary<string, string>();

            cmdKeys  = new CmdKeys();
            fileName = name;
            fileData = ReadDataFile.Load_DataFile(FilePaths.Cmds_Single, fileName).ToList();
            #region - DEBUG - Test print some variables

            /*
             * Console.WriteLine("DEBUG----------- :" + fileName);
             * Console.WriteLine("DEBUG----------- :" + FilePaths.Cmds_Single);
             * foreach (string line in fileData)
             * {
             *  Console.WriteLine(line);
             * }
             * Console.WriteLine("DEBUG---cmdList_single_LoadList :" + cmdList_single_LoadList.Count);
             * Console.WriteLine("DEBUG---cmdList_single :" + cmdList_single_LoadList.Count);
             */
            #endregion
        }
        public void ProcessCommand(Dictionary <string, string> CmdList, string filePath, string fileName)
        {
            List <string> fileDataList = new List <string>(ReadDataFile.Load_DataFile(filePath, fileName));

            string value = ReadDataFile.Read_RawSingleLine(cmdKeys.cmdName, fileDataList);

            int[]         brackest = ReadDataFile.FindUniqueBrackets(cmdKeys.cmdSynonymList_Start, cmdKeys.cmdSynonymList_End, fileDataList);
            List <string> keys     = ReadDataFile.Read_WordLists(brackest[0], brackest[1], fileDataList);

            AddSafe(CmdList, value, value);
            foreach (string synonym in keys)
            {
                #region Test Prints
                //Console.WriteLine(value + ", " + synonym);
                //AddSafe(CmdList, TextUtils.StemWord.Stem(synonym).Value, value);
                //string StemValue = TextUtils.StemWord.Stem("looking").Value;
                #endregion
                AddSafe(CmdList, synonym, value);
            }
            #region - DEBUG - Test print some variables

            /*foreach (string line in fileDataList)
             * {
             *  Console.WriteLine(line);
             * }
             * Console.WriteLine(value);
             * foreach (int brack in brackest)
             * {
             *  Console.WriteLine(brack);
             * }*/
            #endregion
        }
 private void ProcessData()
 {
     area.SetName(ReadDataFile.Read_RawSingleLine(areaKeys.areaName, fileData));
     area.SetLook_Description(ReadDataFile.Read_RawSingleLine(areaKeys.areaLook_Description, fileData));
     area.SetCinimatic(ReadDataFile.BetweenUniqueBrackets(areaKeys.areaCinamatic_Start, areaKeys.areaCinamatic_End));
     ProcessAllItems();
     ProcessAllExits();
 }
Beispiel #4
0
        //Between Brackets, Read RAW lines into a List<string>
        public static List <string> BetweenUniqueBrackets(string start, string end)
        {
            List <string> data = new List <string>();

            int[] brackets = ReadDataFile.FindUniqueBrackets(start, end, fileData);
            data = ReadDataFile.Read_Cinamatic(brackets[0], brackets[1], fileData);
            return(data);
        }
Beispiel #5
0
 public DataRead_Items(string name)
 {
     item     = new Items();
     itemKeys = new ItemKeys();
     fileName = name;
     fileData = ReadDataFile.Load_DataFile(FilePaths.Items, fileName);
     ProcessData();
 }
 //Constructor
 public DataRead_Area(string name)
 {
     area     = new Area();
     areaKeys = new AreaKeys();
     //exitKeys = new ExitKeys();
     fileName = name;
     fileData = ReadDataFile.Load_DataFile(FilePaths.Areas, fileName).ToList();
     ProcessData();
 }
Beispiel #7
0
        private void ProcessData()
        {
            //Console.WriteLine("Processing : " + fileName);
            item.name            = ReadDataFile.Read_RawSingleLine(itemKeys.itemName, fileData);
            item.PickedupAllowed = ReadDataFile.Read_RawSingleLine(itemKeys.itemCanBePickedip, fileData).Equals("true"); //reads a text string "true" or "false". if that is "equal to true" it returns "bool true", otherwise return "bool false"

            item.description_Default = ReadDataFile.Read_RawSingleLine(itemKeys.DescriptionDefault, fileData);
            item.getItem_Failed      = ReadDataFile.Read_RawSingleLine(itemKeys.itemGetFailed, fileData);
        }
        private void ProcessAllItems()
        {
            BracketCounts brackets = new BracketCounts();

            brackets = ReadDataFile.Read_BracketCount(areaKeys.itemsStart, areaKeys.itemsEnd, fileData);
            for (int i = brackets.start[0] + 1; i < brackets.end[0]; i++)
            {
                DataRead_Items BuildItem = new DataRead_Items(fileData[i]);
                area.AddItem(BuildItem.GetItem());
            }
        }
        public Dictionary <string, string> ProcessAll_SingleCommands()
        {
            cmdKeys.cmdName = "//--Single_Word_Command:";
            BracketCounts brackets = new BracketCounts();

            brackets = ReadDataFile.Read_BracketCount(cmdKeys.cmdList_Start, cmdKeys.cmdList_End, fileData);
            for (int i = brackets.start[0] + 1; i < brackets.end[0]; i++)
            {
                //Console.WriteLine("DEBUGGING ---- : " + fileData[i]);
                ProcessCommand(cmdList_single, FilePaths.Cmds_Single, fileData[i]);
            }
            return(cmdList_single);
        }
        private void ProcessAllExits()
        {
            BracketCounts brackets = new BracketCounts();

            brackets = ReadDataFile.Read_BracketCount(areaKeys.exitStart, areaKeys.exitEnd, fileData);

            int        exitAmount         = brackets.bracketCount;
            List <int> bracketIndex_Start = brackets.start as List <int>;
            List <int> bracketIndex_End   = brackets.end as List <int>;

            for (int i = 0; i < exitAmount; i++)
            {
                DataRead_Exits BuildExits = new DataRead_Exits();
                area.AddExit(BuildExits.ProcessExits(bracketIndex_Start[i], bracketIndex_End[i], fileData));
            }
        }
        public Dictionary <string, string> ProcessAll_ConstantCommands()
        {
            // set file stuff
            cmds            = new Dictionary <string, string>();
            cmdKeys.cmdName = "//--Base:";
            fileData        = ReadDataFile.Load_DataFile(FilePaths.Cmds_Constant, fileName).ToList();

            BracketCounts brackets = new BracketCounts();

            brackets = ReadDataFile.Read_BracketCount(cmdKeys.cmdList_Start, cmdKeys.cmdList_End, fileData);
            for (int i = brackets.start[0] + 1; i < brackets.end[0]; i++)
            {
                //Console.WriteLine("DEBUGGING ---- : " + fileData[i]);
                ProcessCommand(cmds, FilePaths.Cmds_Constant, fileData[i]);
            }
            return(cmds);
        }
Beispiel #12
0
        public Exit ProcessExits(int start, int end, List <string> fileData)
        {
            Exit exit = new Exit();

            start = start + 1;
            for (int i = start; i < end; i++)
            {
                exit.name      = ReadDataFile.ReadData_LinesInsideBrackets(exitKeys.name, fileData, start, end);
                exit.direction = ReadDataFile.ReadData_LinesInsideBrackets(exitKeys.direction, fileData, start, end);

                exit.avaliable = ReadDataFile.ReadData_LinesInsideBrackets(exitKeys.avaliable, fileData, start, end).Equals("true");
                exit.open      = ReadDataFile.ReadData_LinesInsideBrackets(exitKeys.isOpen, fileData, start, end).Equals("true");

                exit.look_at_exit      = ReadDataFile.ReadData_LinesInsideBrackets(exitKeys.lookAtExit, fileData, start, end);
                exit.move_Through_exit = ReadDataFile.ReadData_LinesInsideBrackets(exitKeys.MoveThroughExit, fileData, start, end);
            }
            return(exit);
        }