Example #1
0
        /// <summary>
        /// Get an existing set of extras if it exists or an empty one if not yet created
        /// </summary>
        /// <param name="MatchID">The Match ID</param>
        /// <param name="Us">For them or us?</param>
        public Extras(int MatchID, ThemOrUs Who)
        {
            _who = Who;
            Dao myDao = new Dao();

            _data = myDao.GetExtras(MatchID, Who);
        }
Example #2
0
    /**
     * Método para salvar as informações carregadas em arquivo
     * @return true=Salvou os dados no arquivo	false=Deu alguma merda
     */
    public bool Save()
    {
        BinaryFormatter bf   = new BinaryFormatter();
        FileStream      file = File.Create(Application.persistentDataPath + "/UnlockedExtras.dat");

        ExtrasData ed = new ExtrasData();

        ed.arrJournal = this.arrJournal;
        ed.arrLore    = this.arrLore;
        ed.arrBios    = this.arrBios;

        bf.Serialize(file, ed);

        file.Close();

        return(true);
    }
Example #3
0
    /**
     * Método para carregar quais extras já foram desbloqueados
     * @return true=Carregou os dados no arquivo	false=Arquivo não existente
     */
    public bool Load()
    {
        //Verifica se o arquivo existe
        if (File.Exists(Application.persistentDataPath + "/UnlockedExtras.dat"))
        {
            BinaryFormatter bf   = new BinaryFormatter();
            FileStream      file = File.Open(Application.persistentDataPath + "/UnlockedExtras.dat", FileMode.Open);

            ExtrasData ed = (ExtrasData)bf.Deserialize(file);
            file.Close();

            this.arrJournal = ed.arrJournal;
            this.arrLore    = ed.arrLore;
            this.arrBios    = ed.arrBios;

            return(true);
        }
        else
        {
            return(false);
        }
    }