Ejemplo n.º 1
0
        /// <summary>
        /// </summary>
        /// <param name="i"></param>
        /// <returns></returns>
        public GameState this[int i]
        {
            get { return(GameStates[i]); }            //ToDo: Sort by date
            set
            {
                //There is no "Add new slot" it only overrides what's already present
                //GameState[] s = new GameState[Saves.Count];
                //Saves.CopyTo(s);
                //s[i] = value;
                //Saves = new HashSet<GameState>(s);

                //Rewrote to override old save file with new one
                if (Saves.Contains(value))
                {
                    Saves.Remove(value);
                }
                if (value.TimeCreated.Ticks != new DateTime().Ticks || (value.TrainerID != 0 && value.SecretID != 0))
                {
                    Saves.Add(value);
                }
            }
        }