コード例 #1
0
    public async void InitializeSaveSystem(XboxLiveContext context)
    {
        m_context = context;

        if (context == null)
        {
            LogLine("Resetting save system.");
            LogLine("");

            m_saveManager.Reset();
        }
        else
        {
            try
            {
                LogLine("Initializing save system...");
                GameSaveErrorStatus status = await m_saveManager.Initialize(context);

                if (status == GameSaveErrorStatus.Ok)
                {
                    LogLine("Successfully initialized save system.");
                }
                else
                {
                    LogLine(String.Format("InitializeSaveSystem failed: {0}", status));
                }
            }
            catch (Exception ex)
            {
                LogLine("InitializeSaveSystem failed: " + ex.Message);
            }

            LogLine("");
        }
    }
コード例 #2
0
    private async void SaveData()
    {
        try
        {
            GameSaveErrorStatus status = await m_saveManager.SaveData(m_gameData);

            if (status == GameSaveErrorStatus.Ok)
            {
                LogLine(String.Format("Saved data : {0}", m_gameData));
            }
            else
            {
                LogLine(String.Format("SaveData failed: {0}", status));
            }
        }
        catch (Exception ex)
        {
            LogLine("SaveData failed: " + ex.Message);
        }

        LogLine("");
    }
コード例 #3
0
    private async void DeleteContainer()
    {
        try
        {
            GameSaveErrorStatus status = await m_saveManager.DeleteContainer();

            if (status == GameSaveErrorStatus.Ok)
            {
                LogLine("Deleted save container.");
            }
            else
            {
                LogLine(String.Format("DeleteContainer failed: {0}", status));
            }
        }
        catch (Exception ex)
        {
            LogLine("DeleteContainer failed: " + ex.Message);
        }

        LogLine("");
    }
コード例 #4
0
 public LoadDataResult(GameSaveErrorStatus statusValue, int dataValue)
 {
     Status = statusValue;
     Data   = dataValue;
 }