Пример #1
0
        private List <IGameFile> CreateTestFileList()
        {
            List <IGameFile> files = new List <IGameFile>();
            int count = 0;

            for (int i = 0; i < 3; i++)
            {
                DoomLauncher.DataSources.GameFile gameFile = CreateGameFile(string.Format("Test{0}.Zip", ++count), count);
                gameFile.GameFileID = count;
                files.Add(gameFile);
            }

            for (int i = 0; i < 3; i++)
            {
                DoomLauncher.DataSources.GameFile gameFile = CreateGameFile(string.Format("TEST{0}.Zip", ++count), count);
                gameFile.GameFileID = count;
                files.Add(gameFile);
            }

            for (int i = 0; i < 3; i++)
            {
                DoomLauncher.DataSources.GameFile gameFile = CreateGameFile(string.Format("TEST{0}{1}.Zip", s_garbage, ++count), count);
                gameFile.GameFileID = count;
                files.Add(gameFile);
            }

            return(files);
        }
Пример #2
0
        private GameFile CreateGameFile(string filename, int count)
        {
            DateTime dt = DateTime.Parse("1/1/17");

            DoomLauncher.DataSources.GameFile gameFile = new DoomLauncher.DataSources.GameFile();
            gameFile.FileName                = filename;
            gameFile.Author                  = string.Format("Author_{0}", filename);
            gameFile.Description             = string.Format("Description_{0}", filename);
            gameFile.Title                   = string.Format("Title_{0}", filename);
            gameFile.Comments                = string.Format("Comments_{0}", filename);
            gameFile.ReleaseDate             = dt;
            gameFile.Downloaded              = dt;
            gameFile.LastPlayed              = dt;
            gameFile.IWadID                  = count;
            gameFile.Rating                  = count;
            gameFile.MinutesPlayed           = count;
            gameFile.MapCount                = count;
            gameFile.SourcePortID            = count;
            gameFile.SettingsExtraParams     = filename;
            gameFile.SettingsFiles           = filename;
            gameFile.SettingsFilesIWAD       = filename;
            gameFile.SettingsFilesSourcePort = filename;
            gameFile.SettingsMap             = filename;
            gameFile.SettingsSkill           = filename;
            gameFile.SettingsSpecificFiles   = filename;

            return(gameFile);
        }
Пример #3
0
        public object Clone()
        {
            GameFile gameFile   = new GameFile();
            var      properties = gameFile.GetType().GetProperties();

            foreach (var prop in properties)
            {
                if (prop.GetSetMethod() != null)
                {
                    prop.SetValue(gameFile, prop.GetValue(this));
                }
            }

            return(gameFile);
        }