Пример #1
0
        public static UserInterfaceData GetData(string data)
        {
            UserInterfaceData userInterfaceData = new UserInterfaceData();

            StringReader reader = new StringReader(data);

            string line       = "";
            int    lineNumber = 0;

            while ((line = reader.ReadLine()) != null)
            {
                lineNumber++;

                if (line == "[/USERINTERFACES]")
                {
                    break;
                }
                else if (line == "[USERINTERFACE]")
                {
                    userInterfaceData.UserInterfaces.Add(ReadUserInterface(ref reader, ref lineNumber));
                }
            }

            reader.Close();
            reader.Dispose();

            return(userInterfaceData);
        }
Пример #2
0
 private void WriteUserInterfaceDataFile(UserInterfaceData userInterfaceData)
 {
     _writer.Write(userInterfaceData.UserInterfaces.Count);
     foreach (var userInterface in userInterfaceData.UserInterfaces)
     {
         WriteUserInterface(userInterface);
     }
 }
Пример #3
0
        private UserInterfaceData ReadUserInterfaceDataFile()
        {
            UserInterfaceData rawFile = new UserInterfaceData();

            int uiCount = _reader.ReadInt32();

            for (int i = 0; i < uiCount; i++)
            {
                rawFile.UserInterfaces.Add(ReadUserInterface());
            }

            return(rawFile);
        }
Пример #4
0
        public static string GetString(UserInterfaceData userInterfaceData)
        {
            StringBuilder builder = new StringBuilder();

            builder.AppendLine("[USERINTERFACES]");

            if (userInterfaceData.UserInterfaces.Count > 0)
            {
                foreach (var userInterface in userInterfaceData.UserInterfaces)
                {
                    builder.AppendUserInterface(userInterface);
                }
            }

            builder.Append("[/USERINTERFACES]");

            return(builder.ToString());
        }
        private void Initialise()
        {
            Program.InitialiseData();
            domainDataGrid.DataContext = Program.DataLoadHandler.Domains;

            planeElementDataGrid.DataContext    = Program.DataLoadHandler.PlaneElements;
            planeSizeDataGrid.DataContext       = Program.DataLoadHandler.PlaneSizes;
            planeTypeDataGrid.DataContext       = Program.DataLoadHandler.PlaneTypes;
            speciesTypeDataGrid.DataContext     = Program.DataLoadHandler.SpeciesTypes;
            speciesTraitDataGrid.DataContext    = Program.DataLoadHandler.SpeciesTraits;
            traitCategoriesDataGrid.DataContext = Program.DataLoadHandler.TraitCategories;

            Program.GeneratorConfigurations = new ConfigValues();
            RandomSeedTextBox.Text          = Program.GeneratorConfigurations.RandomSeed;
            _user_interface_data            = new UserInterfaceData();

            debugMessagesTextBlock.DataContext = Program.Debugger;
        }
 static public void Initialise(UserInterfaceData user)
 {
     CosmologyGenerator = new GenerateCosmology(10000000);
     //_creation_myth_generator = new MythCreator();
     //_creation_myth_generator.Initialise(user);
 }
Пример #7
0
 // initialize all the important values, parse the myth files and translate them into myth object data.
 public void Initialise(UserInterfaceData user)
 {
     _user = user;
 }