Exemple #1
0
        private static SealedDeckIndex BuildIndex()
        {
            var index = new SealedDeckIndex();

            foreach (var resource in Folder.ReadAll())
            {
                if (!resource.Name.EndsWith(".dec"))
                {
                    continue;
                }

                var deck = DeckFile.Read(resource.Name, resource.Content);
                index.Entries[resource.Name] = deck.LimitedCode.GetValueOrDefault();
            }

            WriteIndex(index);
            return(index);
        }
Exemple #2
0
 public static void Write(Deck deck)
 {
     Folder.WriteFile(deck.Name, DeckFile.Write(deck));
 }
Exemple #3
0
 public static IEnumerable <Deck> ReadDecks()
 {
     return(Folder.ReadAll().Select(r => DeckFile.Read(r.Name, r.Content)));
 }
Exemple #4
0
        private static Deck Get(string filename)
        {
            var file = Folder.ReadFile(filename);

            return(DeckFile.Read(filename, file.Content));
        }
Exemple #5
0
        public static void Write(Deck deck)
        {
            var filename = String.Format("{0}.dec", Guid.NewGuid());

            Folder.WriteFile(filename, DeckFile.Write(deck));
        }