Esempio n. 1
0
    /// <summary>
    /// Use only when player "First" play this game or
    /// "Reset" the game.
    /// </summary>
    private void CreateDefaultGameData()
    {
        BF_GAME_DATA      = new BF_GameData();
        BF_GAME_DATA.Name = "";
        BF_GAME_DATA.Cash = 1500;       // [default: 1500]


        // save it once
        SaveGameData();
    }
Esempio n. 2
0
    /// <summary>
    /// Use only when player "First" play this game or
    /// "Reset" the game.
    /// </summary>
    private void CreateDefaultGameData()
    {
        GAME_DATA = new BF_GameData();

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

        SaveGameData();
    }
Esempio n. 3
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.
        BF_GAME_DATA = BF_GameData.LoadFromFile <BF_GameData>(mFullFilePath, mFullFileName);
    }