示例#1
0
    /// <summary>
    /// Populate the Context from the save file
    /// </summary>
    /// <param name="desiredData">The type of data to load from the save file</param>
    private static void LoadDataFromSaveFile(DataToLoad desiredData)
    {
        // Retrieve all data from the save file
        PlayerData tmpPlayerData = GameStateUtilities.Load();

        // If the curriculum should be loaded...
        if (desiredData == DataToLoad.Curriculum || desiredData == DataToLoad.Everything)
        {
            // Copy the lessons to the Context
            _curriculum = tmpPlayerData.Curriculum;
            // If the user has not created any lessons, create a sample lesson to work with
            if (_curriculum.Lessons.Count == 0)
            {
                _curriculum.CreateSampleLessons();
            }
        }

        // If the game state should be loaded (ie the user is loading a saved game)...
        if (desiredData == DataToLoad.GameState || desiredData == DataToLoad.Everything)
        {
            // PLACEHOLDER: This code has not yet been implimented
        }
    }
示例#2
0
 /// <summary>
 /// Represents all data that can be saved and loaded
 /// </summary>
 public PlayerData()
 {
     _curriculum = new LessonBook();
 }