예제 #1
0
    /// <summary>
    /// Use only when player "First" play this game or
    /// "Reset" the game.
    /// </summary>
    private void CreateDefaultGameData()
    {
        RC_GAME_DATA      = new RC_GameData();
        RC_GAME_DATA.Name = "";
        RC_GAME_DATA.Gold = 1500;       // [default: 1500]

        RC_GAME_DATA.ItemNo = null;

        // save it once
        SaveGameData();
    }
예제 #2
0
    private void LoadGameData()
    {
        JCS_IO.CreateDirectory(mFullFilePath);

        // if file does not exist, create the default value file!
        if (!File.Exists(mFullFilePath + mFullFileName))
        {
            CreateDefaultGameData();
            return;
        }

        // else we just load the data commonly.
        GAME_DATA = JCS_XMLGameData.LoadFromFile <RC_GameData>(mFullFilePath, mFullFileName);
    }
예제 #3
0
    /// <summary>
    /// Use only when player "First" play this game or
    /// "Reset" the game.
    /// </summary>
    private void CreateDefaultGameData()
    {
        GAME_DATA = new RC_GameData();

        // Set game data's default values
        {
            GAME_DATA.Name = "";
            GAME_DATA.Gold = 1500;       // [default: 1500]

            GAME_DATA.ItemNo = null;
        }

        // save it once
        SaveGameData();
    }