Пример #1
0
        public void CollectionTest()
        {
            var collectionDb = new CollectionDb();
            var logger       = new BasicLogger();

            collectionDb.ReadFile(logger);
            var scores  = collectionDb.Collections.Sum(c => c.Count);
            var deleted = collectionDb.RemoveEmpty();

            collectionDb.WriteFile();
        }
Пример #2
0
        public void Collections()
        {
            var collectionDb = new CollectionDb();

            collectionDb.ReadFile(); //the pathing is autmatic
            //or set it for a different file
            collectionDb.FullPath = @"X:\Some\Custom\Collection.db";
            var collection = new Collection("cool songs");

            collection.Add(new Beatmap());                                       //adding a beatmap
            collection.Add("1ds3a456sdq3dsq56");                                 //or a hash
            collectionDb.AddColection(collection);
            collectionDb.AddColection("other collection", new List <Beatmap>()); //without constructing a collection object
            collectionDb.RemoveEmpty();                                          //looks for collections without items in them and removes those
            collectionDb.WriteFile();
        }