Ejemplo n.º 1
0
    public override void SetConfig(NotebookConfig config)
    {
        base.SetConfig(config);

        // If the acronym is not the same length as the notes, rebuild the notes
        if (config.Acronym.Length != acronymNotes.Count)
        {
            acronymNotes.Clear();

            // Add an empty string for every character
            foreach (char _ in config.Acronym)
            {
                acronymNotes.Add("");
            }
        }
        // Unlock each initial item
        foreach (ItemID item in config.InitiallyUnlockedItems)
        {
            UnlockItem(item);
        }

        // Set config for each sub-module
        research.SetConfig(config);
        observations.SetConfig(config);
        concepts.SetConfig(config);
        testAndMetrics.SetConfig(config);
        reports.SetConfig(config);
    }
    public ObservationsEntryListData(NotebookConfig config, LevelID id) : base(config)
    {
        // Copy the list from the initial entries to this one
        LevelScaffold scaffold = config.Observations.Scaffold;
        List <ObservationsEntryListData> initialEntries = config.Observations.InitialEntries;
        ObservationsEntryListData        copyList       = initialEntries[scaffold.ScaffoldLevel(id)];

        entries = new List <ObservationsEntryData>(copyList.entries);
    }
Ejemplo n.º 3
0
    public ResearchEntryListData(NotebookConfig config, ResearchEntryListConfig listConfig) : base(config)
    {
        entries = new ResearchEntryData[listConfig.Entries.Length];

        for (int i = 0; i < entries.Length; i++)
        {
            entries[i] = new ResearchEntryData(config, listConfig.Entries[i]);
        }
    }
Ejemplo n.º 4
0
    public ResearchData(NotebookConfig config) : base(config)
    {
        // Initialize the list to be parallel to the config list
        researchEntryData = new ResearchEntryListData[config.Research.ResearchEntryLists.Length];

        // Initialize each list in the list of lists
        for (int i = 0; i < config.Research.ResearchEntryLists.Length; i++)
        {
            ResearchEntryListConfig listConfig = config.Research.ResearchEntryLists[i];
            researchEntryData[i] = new ResearchEntryListData(config, listConfig);
        }
    }
Ejemplo n.º 5
0
    public ResearchEncyclopediaArticleData(NotebookConfig config, ResearchEncyclopediaArticleConfig articleConfig) : base(config)
    {
        // Get the text
        string text = articleConfig.RawText;

        // Set start and end indices
        int start = -1;
        // Previous brace found
        char prevBrace = ' ';

        for (int i = 0; i < text.Length; i++)
        {
            if (text[i] == '{')
            {
                // If previous brace also opened, then we have invalid syntax
                if (prevBrace == '{')
                {
                    ReportInitialHighlightError(i, text, "an opening curly brace", "a closing curly brace", articleConfig);
                    return;
                }

                // Set start index and previous brace found
                start     = i;
                prevBrace = '{';

                // Remove the curly brace
                text = text.Remove(i, 1);
                i--;
            }
            else if (text[i] == '}')
            {
                // If previous brace also closed, we have invalid syntax
                if (prevBrace == '}' || prevBrace == ' ')
                {
                    ReportInitialHighlightError(i, text, "a closing curly brace", "an opening curly brace", articleConfig);
                    return;
                }

                // Remove the curly brace
                text = text.Remove(i, 1);

                // Add the highlight now that we found the closing brace
                highlights.Add(new TextHighlight(start, i));
                prevBrace = '}';
            }
        }
    }
Ejemplo n.º 6
0
    public override void SetConfig(NotebookConfig config)
    {
        base.SetConfig(config);

        if (researchEntryData.Length != config.Research.ResearchEntryLists.Length)
        {
            // Initialize the list to be parallel to the config list
            researchEntryData = new ResearchEntryListData[config.Research.ResearchEntryLists.Length];

            // Initialize each list in the list of lists
            for (int i = 0; i < config.Research.ResearchEntryLists.Length; i++)
            {
                ResearchEntryListConfig listConfig = config.Research.ResearchEntryLists[i];
                researchEntryData[i] = new ResearchEntryListData(config, listConfig);
            }
        }
    }
Ejemplo n.º 7
0
 public NotebookData(NotebookConfig config) : base(config)
 {
     // Add an empty string for every character
     foreach (char _ in config.Acronym)
     {
         acronymNotes.Add("");
     }
     // Unlock each initial item
     foreach (ItemID item in config.InitiallyUnlockedItems)
     {
         UnlockItem(item);
     }
     research       = new ResearchData(config);
     observations   = new ObservationsData(config);
     concepts       = new ConceptsData(config);
     testAndMetrics = new TestAndMetricsData(config);
     reports        = new ReportsData(config);
 }
Ejemplo n.º 8
0
    public ResearchEntryData(NotebookConfig config, ResearchEntryConfig entryConfig) : base(config)
    {
        this.entryConfig = entryConfig;

        // Add an empty string for each label in the note labels
        foreach (string _ in entryConfig.NoteLabels.Labels)
        {
            notes.Add("");
        }

        // Double check to make sure you have an encyclopedia
        if (entryConfig.Encyclopedia)
        {
            // Add an empty article data for each article config
            foreach (ResearchEncyclopediaArticleConfig articleConfig in entryConfig.Encyclopedia.Articles)
            {
                articles.Add(new ResearchEncyclopediaArticleData(config, articleConfig));
            }
        }
    }
Ejemplo n.º 9
0
 public virtual void SetConfig(NotebookConfig config)
 {
     this.config = config;
 }
Ejemplo n.º 10
0
 public NotebookDataModule(NotebookConfig config)
 {
     this.config = config;
 }
Ejemplo n.º 11
0
 public ConceptsData(NotebookConfig config) : base(config)
 {
 }
Ejemplo n.º 12
0
 public TestAndMetricsData(NotebookConfig config) : base(config)
 {
 }
Ejemplo n.º 13
0
 public ReportsData(NotebookConfig config) : base(config)
 {
 }
Ejemplo n.º 14
0
 public ObservationsData(NotebookConfig config) : base(config)
 {
 }